The Dens Park outfit had slashed the 15-point deficit at the bottom of the table inherited by John Brown when he took over in February to just eight points.
Victory over the Dons would have reduced it again to five with two to play but their hopes of a remarkable escape act were ended by McGinn's second-half penalty, which secured a 1-1 draw.
Dundee had led through Jim McAlister's deflected strike on 20 minutes and looked in command when the visitors had Rory Fallon sent off after an off-the-ball clash with Declan Gallagher.
But disaster struck when Lewis Toshney brought down Peter Pawlett and McGinn made no mistake from 12 yards to send Dundee down after just one season in the top flight.
Under Brown's charge, the Dark Blues have looked a completely different side to the meek outfit that has won just three times in the SPL during Barry Smith's reign.
The former Rangers defender has instilled grit, determination and no little confidence to their performances but with the threat of demotion hanging over their heads, Dundee's opening quarter-hour display was hallmarked by a series of nervous mistakes in the final third.
Playmaker Gary Harkins, however, is rarely dissuaded from attempting the spectacular and his dipping volley from 25 yards out was only narrowly wide of the target after 16 minutes.And with their swagger returning, it was from similar distance that McAlister struck the opener four minutes later.
Harkins and John Baird combined to tee up the midfielder who, with a helpful nick off Aberdeen defender Mark Reynolds' leg, smashed a dipping volley over Jamie Langfield's despairing reach and into the net.
A second should have arrived on the half hour when Baird again did well to wriggle his way past Joe Shaughnessy and onto the byline before cutting the ball back for Harkins. Finding the net from eight yards out should have been a simple task for the former Kilmarnock man but his side-footed effort was straight at Langfield.
The Aberdeen stopper's opposite number Steve Simonsen was just as heroic for the hosts as first he reacted brilliantly to get a strong hand to Ryan Jack's low 25-yard drive after it took an unexpected bounce off the rutted Dens pitch before he leapt up to deny Pawlett from close range at the rebound.
Langfield had to gather another long-distance attempt, this time from Baird, at the second attempt on 39 minutes while the Dee striker passed up an even better opportunity from seven yards on the angle just before the half-time whistle.
There was time for McAlister to appeal for a penalty before the teams disappeared down the tunnel but referee Alan Muir ruled Isaac Osbourne's challenge was fair.
Aberdeen made a livelier start to the second 45 than they did the first and were within an inch or two of an equaliser as Pawlett struck a curling effort from outside the box just wide of Simonsen's right-hand post.
However, their job was made all the more difficult when they lost Fallon after 62 minutes.
The striker was stationed alongside Gallagher on the 18-yard line as a cross came in but the Dundee man hit the deck clutching his face. Muir consulted with linesman Stuart Hodge before deciding an arm had been swung by the Dons player as he issued the straight red.
Dundee came close to making the most of their man advantage almost immediately as Brian Easton redirected Matt Lockwood's corner towards the bottom corner of the goal but Langfield was down smartly to save.
But just as Dundee looked set to complete the latest stage in their desperate fight against the drop, Toshney suffered a rush of blood to the head.
The Scotland Under-21 defender did not need to dive in on Pawlett as the midfielder darted into a loose ball but was reckless as he tripped his opponents near the byline.
Muir was without hesitation as he awarded the 69th-minute penalty which was emphatically scored by McGinn.
There was fury from the home support when the ex-Celtic attacker wheeled away to celebrate in front of them and he was punished with a booking while Pawlett was soon replaced by Josh Magennis after he and McAlister had to be separated in the moments after the goal.
Dundee knew their situation was desperate but came close to the goal they needed when McAlister saw his looping header saved by the fingertips of Simonsen.
Muir added four minutes of additional time but it was not long enough to find the life-saving goal that Dundee needed as their last stand ended in disappointment.
- Sports & Recreation
- Peter Pawlett
- Jamie Langfield