Northampton stormed into the play-offs thanks to their fifth away win in six matches in what turned out to be a dress rehearsal for the semi-final.
Robert Ullathorne sprung the offside trap to strike the winner in the 70th minute, 16 minutes after Colin Larkin had cancelled out Eric Sabin's first half breakthrough.
And the in-form Cobblers knew it was going to be their day when Mansfield midfielder Craig Disley missed a late sitter, mis-kicking Jamie Clarke's cross in front of goal.
The Cobblers, roared on by 2,500 travelling fans, squandered the first chance after just six minutes when Sabin burst through before poking wide from close range.
But the big striker made no mistake in the 18th minute with a scorching drive from the edge of the area which keeper Kevin Pilkington could only help into the top corner.
It took the out-of-sorts Stags 31 minutes to create an opportunity in front of goal and Larkin's clever back-header was easily saved.
Northampton looked far more determined throughout and Sabin should have secured their play-off place before half time, skying high from 20 yards after a mazy Josh Low run.
On a rare break-away in the 53rd minute Mansfield midfielder Lee Williamson saw his close range shot deflected onto the post and out for a corner.
From Liam Lawrence's resulting flag-kick Larkin volleyed in the surprise equaliser at the far post to silence Northampton's supporters.
At that stage, the visitors were out of the play-offs and for the first time in the game were under pressure as Williamson scraped the woodwork with a long range pile driver.
Three minutes later Northampton regained the lead when Ullathorne broke clear down the left flank and cut inside before driving the winner into the net off keeper Pilkington.
However, the Cobblers quickly regained their composure and control of the match. In the 67th minute Paul Trollope smashed a 25 yard drive against the angle of the post and bar.