
Blair Spittal (right) scored his first goal of the season to give United victory
Dundee United won to send St Mirren into the Scottish Championship's relegation play-off spot.
Thomas Mikkelsen fired United ahead as St Mirren players claimed for a foul but Gary Mackenzie headed the Buddies level before the break.
Tony Andreu struck a free-kick from inside the box for the Tangerines' second only for Josh Todd to equalise.
But Blair Spittal's late shot gave the hosts the victory they craved, leaving St Mirren two points off bottom.
Ray McKinnon's United, who remain third and are assured of a promotion play-off place, took the lead in controversial circumstances. Striker Mikkelsen went in with a high boot on Mackenzie but referee Craig Charleston waved play on and the Finn hammered the ball high into the roof of the visitors' goal.
Mackenzie had to receive treatment at the side of the pitch with the entire St Mirren bench, including manager Jack Ross, furious by the call from the officials.

St Mirren felt they should have had a free-kick in the run-up to Mikkelsen's goal
Buddies captain Stephen McGinn had a half-chance for an equaliser with a header from a Lewis Morgan cross but there was little pace on the ball, which was gathered by Cammy Bell in the home goal.
Stevie Mallan was again showing the type of skills that has brought about interest from English clubs and was inches away with a free-kick that ended up in the Dundee United goal's side netting.
St Mirren continued to drive forward and deservedly equalised before the break. Mallan whipped in a free-kick at pace from the right-hand side that was met by the head of Mackenzie and Bell was beaten.
Simon Murray crashed a shot off the St Mirren crossbar from 25 yards and United then regained the lead in bizarre circumstances. Keeper Billy O'Brien picked up a pass-back inside his own box under pressure from Murray.
The free-kick was slipped to Andreu, who drilled through a ruck of defenders.
The visitors pushed more and more men forward looking for the equaliser and they were rewarded for their persistent pressure when substitute Todd hooked home from 12 yards out.
However, the home side took the lead for the third time in the final minute when Spittal hammered home from 20 yards.
It was a cruel end to the game for St Mirren, who have two games left to get out of relegation trouble.