St Mirren ended their wait for a win in the Ladbrokes Championship when they beat Queen of the South 3-2 at Palmerston on Tuesday night.
Stephen Dobbie twice had Queens in front but Kyle Magennis and Ben Gordon equalised for Saints, who grabbed a stoppage-time winner through Stevie Mallan.
The result means Jack Ross' side have closed the gap on second-bottom Dunfermline to six points while the Doonhamers, who had new boss Gary Naysmith in charge for the first time, have now lost seven league games in a row.