Donal Henretty scored the winner as Spartans caused the first upset of the Tennent's Scottish Cup third round.
Jubilant Spartans celebrate their opening goal
Queen's Park went ahead after six minutes through Alan Trouten, but Bob Mitchell cancelled out the lead before the interval.
Jon Seeley gave the non-league side a 2-1 lead before Henretty slotted home the third in the 67th minute.
David Weatherston pulled a quick goal back but Spartans held on to claim a place in the fourth round draw.
Spartans: Brown, O'Donnell (Gerrard 60), Fowlie, Burns,
Jon Seeley, Bennett, Manson (Kader 80), Thompson,
Mitchell (Johnson 57), Smart, Henretty.
Subs Not Used: Chris Seeley, Roseburgh.
Goals: Mitchell 44, Jon Seeley 50, Henretty 67.
Queen's Park: Crawford, Clark (Paton 78), Dunlop, Reilly,
Agostini, Trouten, Kettlewell, Quinn (Felvus 78), Weatherston,
Subs Not Used: Molloy, Murray, Cowie.
Goals: Trouten 6, Weatherston 70.
Ref: J Underhill