Forest took the lead in the first half courtesy of a smart chip from Emmanuel Dennis, before Alexander Isak netted just prior to the half-time interval to restore parity in the contest.
Eddie Howe's men had numerous chances in the second period but had to wait until the 93rd minute to seal maximum points - forward Isak bagging his second goal of the night from the penalty spot.
A packed-out City Ground played their part in a frantic start to the match from Forest, with Fabian Schar and Chris Willock early recipients of some questionable tackles from Andre Ayew and Ryan Yates respectively.
The Magpies were inches away from taking the lead after 12 minutes - Kieran Trippier played a free kick smartly through to Isak, and the Swede's strike hit the bar via a deflection off Renan Lodi.
Despite Newcastle's dominance in the opening 25 minutes, it was Steve Cooper's men who took an unexpected lead following a major error from Sven Botman in the visitors' backline.
The Dutchman sold Nick Pope short with a pass - and in truth the 23-year-old was completely unaware of this surroundings, with ex-Watford man Dennis latching onto the ball before delivering a delicate chip into the net over the head of Trippier.
Howe's side were visibly rattled after conceding against the run of play, yet the Magpies managed to level the scores just before the half-time whistle sounded in the East Midlands.
Forest's defensive line was breached by the run of midfielder Willock, and the former Arsenal player provided a pinpoint cross for Isak to volley home past Keylor Navas, with the strike seeming to come off the forward's shin.
The visitors made a change at half time, with Elliot Anderson replacing the less-than-impressive Allan Saint-Maximin, and the 20-year-old was straight into the thick of the City Ground action.
Anderson's far-post header from an Isak cross looked to have put Newcastle into a 64th-minute lead, however Sean Longstaff was adjudged to have been offside in the rather frantic build up.
Jacob Murphy was next to test his shooting boots, but his volley sailed wide of the Forest net, although the visiting Magpies would soon be handed a glorious chance to earn all three points.
Moussa Niakhate handled Isak's header in the box and referee Tierney pointed to the penalty spot, with the Sweden international stepping up and firing the game's winner past Navas to send the away end into delirium.
Forest remain two points in front of the relegation zone following their first defeat at the City Ground since October, and Cooper's charges will look to bounce back when Wolverhampton Wanderers visit from the West Midlands after the international break.
A maximum for the Magpies means they are now just a single point behind fourth-placed Tottenham Hotspur with a game in hand - top-four rivals Manchester United are Newcastle's next opponents at the start of April.