Rangers' reward for is an away semi-final against fellow League One side .
League Two outfit visit from the Scottish Championship in the other semi-final.
Annan travel to Kirkcaldy on Sunday 13 October, while the Ochilview match will be played on Tuesday, 29 October.
It is the second time in three seasons that Annan have been in the last four of the Ramsdens Cup.
are competing in the competition for only the second time, having lost to Queens in last season's quarter-finals.
to reach the last four, while .
And , with the match finishing 1-1 after extra-time.
The Dens Park club's neighbours, Dundee United, were the opposition when Stenny won the trophy in 1996.
None of the other three clubs have lifted the cup for teams outside Scotland's top flight.
Ramsdens Cup semi-finals
Raith Rovers v Annan Athletic (Sunday 13 October)
Stenhousemuir v Rangers (Tuesday, 29 October)