(CNN) -- Substitutes Obafemi Martins and Peter Lovenkrands lifted Newcastle out of the Premier League relegation zone with a 3-1 win over doomed north-east rivals Middlesbrough.
Martins throws himself at manager Shearer after scoring within a minute of his substitute appearance.
Newcastle manager Alan Shearer had called it the biggest match of his career and the former England star can take a big share of the credit for victory as his second half changes proved decisive.
Shearer hauled Martins off the bench to replace Michael Owen after 70 minutes and the Nigerian striker responded within a minute with the goal that put Newcastle in front for the first time.
And four minutes from time Dane Lovenkrands sealed Shearer's first victory in charge and relegated Hull City into the bottom three on goal difference.
It was the first time this campaign Newcastle had scored three goals in a Premier League match and victory gives the club real belief they can preserve their top flight status.
Newcastle face another home game against Fulham on Saturday and finish their campaign at Aston Villa on May 24, while Boro also face Villa, at home, and go to West Ham on the final day. Hull face Bolton and Manchester United.
The late double completed a heroic comeback after Middlesbrough took the lead at St James' Park.
Central defender Steven Taylor headed home Danny Guthrie's ninth-minute corner after Habib Beye's own goal had given the visitors the perfect start within the first two minutes.
Goalkeeper Steve Harper blocked Tuncay Sanli's shot at point-blank range only for the ball to ricochet against Beye and trickle into his own net.
The Magpies' luck deserted them once again when Viduka blasted a sixth-minute shot against the post and Steven Taylor blazed the rebound high over.
But Newcastle were level three minutes later and keeper Brad Jones denied them the lead midway through the half when Owen got a flicked header to Viduka's driven cross, the Australian tipping it over at full stretch.
Nicky Butt was booked for a 31-minute trip on Afonso Alves as the Brazilian broke from his own half, and the Middlesbrough striker was stretchered off three minutes later to be replaced by Marlon King.
Emnes was causing real problems for the home side and his hold-up play allowed Tuncay to set his sights on goal with 41 minutes gone, but the Turkey international blasted over.
It took an excellent save from Harper to keep out Gary O'Neil's goal-bound 57-minute strike, but Shearer's substitutions changed the complexion of the contest.
And Middlesbrough's plight now looks desperate after an 11th successive away league defeat.