The Palmerston side, who defeated Partick Thistle at Livingston last year to lift the trophy, will play Ally McCoist's men if the Govan club can safely navigate round Berwick on Tuesday night following today's draw at Hampden.
If the Ibrox outfit make it to the last eight, they will meet the team which dumped them out of last year's tournament, with now Rangers striker Nicky Clark on target that night for the Second Division champions.
Elsewhere, Raith Rovers play Falkirk at Stark's Park, Dundee entertain Stenhousemuir and Annan have home advantage against Formartine United of the Highland League.
Raith Rovers v Falkirk
Queen of the South v Rangers or Berwick Rangers
Dundee v Stenhousemuir
Annan Athletic v Formartine United
Date for ties - Saturday 7 September, 2013