Middlesbrough led early on courtesy of Habib Beye's own goal, with the ball ricocheting off the defender after keeper Steve Harper had blocked a shot from Tuncay.
But Newcastle hit back almost immediately when defender Steven Taylor firmly headed in from Danny Guthrie's corner.
And in the second half, Newcastle gained the advantage, thanks to Obafemi Martins' low shot, before fellow substitute Peter Lovenkrands made sure of the win when he converted Kevin Nolan's low cross from close range.
"There were some big, big performances from big men, they were brilliant," stated Shearer, who had picked up only two points from five games in charge prior to the visit of Middlesbrough.
"I told my players to enjoy that winning feeling and enjoy being out of the bottom three because it has been a long time coming.
"Hopefully we stay out of there - it's in our own hands now."
Shearer introduced Lovenkrands in place of Jonas Gutierrez on 65 minutes and Martins for captain Michael Owen five minutes later.
Team heartbroken - Southgate
Martins made an immediate impact before Lokenkrands secured the three points and only Newcastle's third victory in 19 outings.
"Someone once told me it's better to be a lucky manager than a good one," revealed Shearer. "I'd be a liar if I said I knew what an impact Oba would have. He's a threat but I didn't expect him to score after 55 seconds.
"We were brilliant and I couldn't have asked any more of the team. To go 1-0 down and come back showed character. It's a magnificent feeling. It's a long time since we had a win."
Middlesbrough manager Gareth Southgate conceded it was a painful evening for the Teesside club.
"There's a lot of frustration and anguish in our dressing room, it's been a painful evening," admitted Southgate, whose team remain on 31 points, three behind Newcastle but with an inferior goal difference.
Harper not getting carried away
"We looked dangerous when we attacked in that opening half-an-hour. Newcastle looked nervous at the back. We scored early and needed to keep that lead for longer.
"They are our local rivals and it's difficult to listen to them celebrating but even though we lost I'm very proud of the players. They are young players who played like men tonight.
"We've got two games left and we've got to try to win those. We've got to hang in there."
Middlesbrough entertain Aston Villa on Saturday before taking on West Ham at Upton Park on the last day of the season.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.