Fourth-tier The Spartans will visit Aberdeen in the Premier Sports Cup quarter-finals after knocking out Ross County.
Holders Rangers host Dundee, while Celtic welcome Championship side Falkirk, who shocked Hearts 1-0 in the last 16.
Motherwell and Dundee United face off in an all-Premiership affair.
The ties will be played on the weekend of 21-22 September.
Spartans stunned top-flight County 1-0 on Saturday to became the first fourth-tier side to make the last eight since Rangers in 2012.
Last-eight draw: Motherwell v Dundee Utd; Aberdeen v Spartans; Rangers v Dundee; Celtic v Falkirk.