The Blue Square Bet Premier play-off final appeared destined for extra time until Christian Jolley latched on to a long pass and sent the ball past goalkeeper Chris Maxwell in the 86th minute.
Substitute Aaron O'Connor then added a second in the fourth minute of injury time, his 21st goal of the campaign.
Newport, managed by former Tottenham defender Justin Edinburgh, will now play npower League Two football next season for the first time since 1988, having narrowly avoided relegation from the top flight of non-league football last season.
Wrexham wasted several chances, with Brett Ormerod particularly wasteful, and tasted agonising defeat six weeks after their FA Trophy glory at Wembley.
This afternoon's success for Newport completes a remarkable season for Welsh football in which, added to Wrexham's Trophy celebrations, Swansea won the Capital One Cup and Cardiff were promoted to the Barclays Premier League.
The Dragons dominated the majority of the first half and enjoyed chances to open the scoring, Ormerod missing the target on three separate occasions when he really should have done better.
But, having been second best for the first 40 minutes, Newport twice came close to breaking the deadlock in the closing minutes of the half through Jolley and Lee Minshull.
Ormerod was at the centre of the action again midway through the second period as he fired over from close range after player/manager Andy Morrell had seen his shot saved.
Johnny Hunt forced Lenny Pidgeley to parry his effort to safety in the 63rd minute but the clash remained finely poised heading into the closing stages.
That was until four minutes remaining when Jolley ran on to a long ball over the top and fired home to sent the Newport supporters into raptures.
O'Connor then made the game safe deep into added time when he converted the rebound after Maxwell had saved his initial effort.