Rock bottom Northampton looked destined for the drop after Vale turned the game on its head in a breathtaking finish.
Lawrie Dudfield's 89th minute strike appeared to give the Cobblers hope and new manager Martin Wilkinson, promoted from caretaker boss on Friday, a dream start.
But with most of the home fans flooding towards the exit, Vale stormed back to virtually secure their second division safety with goals from Peter Clarke and Adrian Littlejohn.
Vale dominated the first half with some entertaining football and Northampton were fortunate to reach the interval just one down.
The goal arrived in the 11th minute when defender Michael Walsh strode forward to net an unstoppable header from John Durnin's right wing free-kick.
But other chances went begging and visiting keeper Lee Harper did well to keep out two well struck shots from Stephen McPhee.
Town's only decent effort of the first period was a 25-yard strike from man-of-the-match Christian Hargreaves, which Dean Delaney turned out for a corner.
But it was totally different story in the second period as only inspired keeping by Delaney kept Vale in the contest.
The young Irishman produced splendid saves to deny Tom Youngs twice, Ian Sampson and substitute Dudfield.
But there was nothing Delaney could do in the 62nd minute when Marco Gabbiadini rammed in a close-range shot from a Hargreaves cross.
The goal set up a grandstand finish and Dudfield sent the travelling fans wild with delight when he fired in Paul Harsley's cross.
But Clarke equalised when he headed in Matthew Carragher's cross and Littlejohn rifled the winner from McPhee's pass.
Breathless Vale boss Brian Horton said: "I can hardy believe that. We were out own worst enemies because we tried to coast to a 1-0 win.
"But at the end of the day the players have shown the bottle to come back and take three points which give us a great chance of staying up." A gutted Wilkinson said: "This was a must win game and we should have won it. Our defending was criminal at the end and we are bitterly disappointed.
"But I cannot fault the lads for effort. They have given me everything and in that respect I have no complaints."