Stockport County 1 Brentford 2
With six games remaining in the domestic programme, there is no way back for the Hatters who must now resign themselves to playing in League Two next term.
A 57th minute goal from Scott Fitzgerald and a 84th minute close-range strike from Sam Sodje was enough for Brentford to sink County, their 27th loss of a miserable season.
Having lost manager Sammy McIlroy midway through the season, new Stockport boss Chris Turner has been unable to save the Cheshire side from the drop.
And with the club seemingly close to being sold to the Stockport County Supporters' Trust by the end of April, there is no shortage of transition and hard work to be done at Edgeley Park in the close season.
The home side battled bravely in a dull first half, but Martin Allen's Brentford started the brighter after the break and deserved their slender advantage.
But when Sodje fouled striker Adam Le Fondre in the 80th minute, the young striker made no mistake to level matters from the penalty spot.
However, Sodje turned from villain to hero six minutes later when he was well placed to fire home inside the box after Scott Fitzgerald saw a header hit the post.
Stockport manager Turner was upbeat despite defeat and vowed his team would bounce back next season.
"This club just needs a good season," said Turner. "The club has lived beyond its means. We've been down quicker than the Titanic and it has felt like we've been on a runaway train for a while.
"But as long as we have a good season next year, then I'll be happy. The club and the fans need a good season.
"Winning at Edgeley Park is what I want and anything away from home is going to the icing on the cake. This clubs needs a steady period."
Brentford manager Martin Allen couldn't quite believe how his side managed to snatch a last-gasp victory.
"Who would have thought we would have won 2-1 after conceding a late penalty? I'm so proud of all the players," he said.
"The players were very down this week in training. I had to kiss and cuddle them to get them up for this game - and they responded brilliantly.
"It was a great day for all our supporters who made the trip to watch. The players were very, very special."