Raith Rovers are up to third place in the Ladbrokes Championship after beating St Mirren 2-1 in Paisley on Friday night.
James Craigen gave Ray McKinnon's side a 12th-minute lead with a fine finish but Lawrence Shankland, on loan from Aberdeen, equalised just before the break.
Rovers grabbed the winner with three minutes left when Grant Anderson was credited with getting the final touch to beat keeper Jamie Langfield.