St Mirren leapfrogged Dundee at the bottom of the Ladbrokes Premiership after recovering from an early blow to win 2-1 in an enthralling encounter.
Sunderland loanee Ethan Robson swept in his first goal for the Taysiders within a minute of the kick-off at the Simple Digital Arena, but that was cancelled out in the 12th minute by returning Saints attacker Danny Mullen.
Both sides went at each other with some enthusiasm but in the 58th minute midfielder Brad Lyons, on loan from Blackburn, headed in his first St Mirren goal to take Oran Kearney's side two points clear of Dundee and into the relegation play-off spot, with two fixtures remaining before the split.
It was a morale-boosting win for the Paisley side and a body blow to Jim McIntyre's men, who have now lost five in a row.
After losing 1-0 at St Johnstone in midweek, Kearney brought back Duckens Nazon, Anders Dreyer, Mullen and Gary MacKenzie, the latter appearing for the first time since May 2018 after recovering from an Achilles injury.
However, it was the Taysiders, with strikers Andrew Nelson and Craig Curran back in the starting line-up, who got off to the best possible start when midfielder Robson nipped in at the near post to convert John O'Sullivan's cross from the right with just seconds on the clock.
The vociferous away support almost had a second goal to cheer minutes later when Nelson slalomed his way to the edge of the box before firing just past the post.
St Mirren looked on the ropes but they levelled unexpectedly when Mullen, making his first start since December, got a touch on Nazon's cross and the ball evaded Dundee keeper Seny Dieng.
The home side were instantly energised but Buddies keeper Vaclav Hladky had to produce a brilliant block to deny Curran's close range shot.
The Dark Blues attacker had drifted behind the St Mirren defence to take a pass from O'Sullivan, whose dipping cross moments later had to be tipped over by Hladky, who made another good save from Nelson's powerful drive early in the second half.
Simeon Jackson, dropped after missing a penalty against St Johnstone, replaced Nazon in the 55th minute but moments later, after Mihai Popescu's raking cross from the left was headed into the box by Anders Dreyer, it was Lyons who rose to power in a header to put the home side ahead.
The 1,600 or so travelling fans began to show their displeasure at their own side as St Mirren kept control for the most part.
Dieng denied Lyons a second with a fine save and Dreyer headed the rebound over as St Mirren came close again before surviving four tense minutes of added time.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Ronnie Esplin, Press Association Sport');
ga('pacontentapi.set', 'dimension2', 'a882d297-fc58-4be6-a6c9-35d3557595ab');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:club-news,paservice:sport:football,paservice:sport:match-reports');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'St Mirren beat relegation rivals Dundee to climb off bottom of Ladbrokes Premiership'});