Dundee averted relegation for another week after Ryan Conroy's 30-yard free-kick earned them a third consecutive victory as they beat Hearts 1-0.
Conroy's deflected effort found the net with 10 minutes left of a nervy performance against 10-man Hearts, which left the hosts eight points adrift with three games left in the Clydesdale Bank Premier League.
But with St Mirren securing a 3-3 draw with Hibernian, Dundee need to win all of their remaining games and hope St Mirren lose all of theirs as the Paisley side are 24 goals better off than John Brown's men.
Dundee, without the influential Gary Harkins, struggled to exploit their man advantage after Andy Webster was sent off in the 28th minute but substitute Conroy produced the goods as a rollercoaster affair at Easter Road kept the Dens Park crowd on their toes.
Dundee have now only lost once in eight SPL games since Brown took over from Barry Smith on a short-term basis, a record that earned the former Dundee player a two-year contract extension on the eve of the match.
Hearts, without the injured Danny Wilson, were also chasing a hat-trick of victories and they had the first chance from a 20-yard free-kick but Steven Simonsen held Jamie Hamill's powerful drive.
Dundee improved after a slow start and their first opportunity also came from a free-kick after Webster was booked for bringing down Carl Finnigan.
Kyle Benedictus powered a rising strike from 30 yards which Jamie MacDonald pushed over the bar.
Dundee claimed for a penalty when Hamill caught Finnigan with a high boot in the face but referee John Beaton restarted with a drop-ball after stopping play for treatment to the former Falkirk striker.
The home physio was called into action again seconds later when Webster caught John Baird from behind as he led with his arm at an aerial challenge in the centre circle. Both players went down in agony but more misery awaited the Hearts defender as Beaton showed him a second yellow and red card when he got back on his feet.
The home side cranked up the pressure and Baird and Lewis Toshney fired wide after half-cleared corners before MacDonald saved Jim McAlister's header.
Hearts manager Gary Locke had moved Darren Barr back to fill the space left by Webster and he made a change with Mehdi Taouil replacing striker Michael Ngoo, who then received treatment for his shoulder injury.
The Dundee fans were soon chanting the name of former Dens Park striker Leigh Griffiths after news broke that he had opened the scoring for Hibs. But they had little else to shout about for the remainder of the half and the Great Escape theme tune that greeted Dundee's re-emergence for the second half did not appear to resonate much with the home fans in the 5,896 crowd.
Half-time substitute Conroy was quickly involved, curling in a corner that Brian Easton headed off the bar.
Another new introduction, Hearts midfielder Dale Carrick, was also in the heart of the action when he ran on to Jason Holt's pass, but the angle proved too tight and he shot wide.
The Hearts fans were quick to reinforce Dundee's predicament after word emerged that Esmael Goncalves had levelled for St Mirren. Brown brought on Nicky Riley and Colin Nish as Dundee pressed for the winner they needed.
Conroy fired just wide from 25 yards before Hibs regained the lead and Declan Gallagher headed a decent chance over from 12 yards just before St Mirren levelled at Easter Road.
Dundee looked devoid of ideas and were lacking composure in the final third but Conroy sent the home fans into wild celebrations when his free-kick appeared to take a deflection and left MacDonald motionless as the ball bounced into the corner of the net.
The joy was short-lived as the Hearts fans were soon cheering a third goal for St Mirren, but the Dundee fans were soon celebrating again though with news of another Griffiths goal to keep their hopes alive for at least another week.