Visiting forward Dan MacKay was prevented the opener by the feet of goalkeeper Calum Ferrie in the 10th minute. But MacKay was not to be denied as he slotted home in the 27th minute after the ball had fallen to him off the back of Billy McKay.
Queen's Park levelled in the 64th minute when Grant Savoury headed home from a Connor Shields cross and grabbed what turned out to be the winner six minutes later through Stephen Eze's header at the back post from a Dom Thomas corner.
Title-chasers Partick Thistle and Dundee lost ground as they cancelled each other out in a goalless draw at Firhill. Dundee started brightly as Luke Hannant had an effort saved by Thistle goalkeeper David Mitchell. The hosts worked their way into the game and Scott Tiffoney managed to get clear of the Dundee defence but goalkeeper Adam Legzdins was equal to his effort. Luke McCowan threatened on a couple of occasions for Dundee after the break and Thistle's Anton Dowds had a late chance but he could not get the shot away as it finished all square.
Ayr United stayed in the title hunt with a 2-0 victory at rock-bottom Hamilton Accies. Ben Dempsey opened the scoring with a penalty after 12 minutes, firing low and hard following a handball. The visitors always looked dangerous and Paddy Reading's shot from the edge of the area cleared the crossbar before Sam Ashford doubled their advantage after 27 minutes with a first-time finish from Dipo Akinyemi's fine pass.
Raith Rovers cruised to a first league win in four matches with a 6-1 victory against Cove Rangers. Esmael Goncalves got the ball rolling in the third minute when he made the most of a poor goal-kick to dink the ball over goalkeeper Kyle Gourlay. Lewis Vaughan with two, Ryan Nolan, Dylan Easton and Scott McGill scored the others for the Kirkcaldy side.