Motherwell will be the first top-flight opponents for Rangers since they were relaunched in the Irn-Bru Third Division after the teams were paired together in the Scottish Communities League Cup.
The Clydesdale Bank Premier League leaders will visit Ibrox on September 25-26 in the third round.
Celtic were drawn out just before Rangers, at home against Raith Rovers, the team that shocked them in the 1994-1995 final.
Rangers have beaten East Fife and Falkirk on their way to the third round with Motherwell entering at this stage along with their fellow European qualifiers.
The seeded draw paired the eight SPL teams remaining in the tournament with lower-league clubs.
Queen of the South have another home tie, against Dundee United, after beating Hibernian at Palmerston.
Stenhousemuir have been rewarded for beating holders Kilmarnock with a home game against Inverness.
Queen's Park, conquerors of Dundee, face another Tayside club in St Johnstone while Hearts have a home clash against Livingston.
St Mirren host Hamilton while Aberdeen face a trip to Fife to take on Dunfermline.