Anthony Howell's close-range header in the final minute settled a physical clash 2-1 in favour of struggling Mansfield over Newport.
Matt Rhead headed a right-wing cross back in front of goal, where a brave Howell stooped to apply the killer blow.
Earlier it had been a tale of two goalkeeping errors that had seen Stags go ahead and Newport level matters.
The game ended with seven bookings and it was just a surprise it ended 11 v 11.
The first half was a physical affair which lacked quality and goalmouth excitement.
But the home side did go ahead after 28 minutes when Ryan Tafazolli headed Ben Hutchinson's free-kick goalwards from six yards and goalkeeper Elliot Parish failed to hold on to the ball and allowed it to drop over the goal-line.
However, the visitors were level five minutes into the second half.
Alan Marriott came out to claim Tom Naylor's long free-kick from the right, but the 'keeper failed to hold on and spilled the ball at the feet of Rene Howe, who flicked it into the empty net from eight yards.
Newport enjoyed their best spell of the afternoon, Adam Chapman narrowly wide from 25 yards with Lee Minshull also firing a 20-yard effort just over the angle.
For Stags, Howell flicked a header over from five yards as Parish left his line to challenge him.
But Howell's big moment came in the 90th minute and provided Stags with three crucial points.