Kevin Nolan struck his eighth goal of the season two minutes into injury-time to end Newcastle's four-match winless run and preserve their unbeaten home record as Doncaster were beaten 2-1.
The former Bolton midfielder's 18-yard drive went in off the post to cap a stirring comeback from the home side who had initially trailed to Dean Shiels' 18th-minute opener.
Andy Carroll had shrugged off a string of horror misses to bring Newcastle level midway through the second half, while Martin Woods missed a penalty for Doncaster.
The home side also had Zurab Khizanishvili sent off for reacting to a challenge by Billy Sharp in a frantic finish.
The win also means that United caretaker boss Chris Hughton can go into his proposed contract talks with owner Mike Ashley tonight in better heart.