Newcastle United 1 Mansfield Town 0
But it was an afternoon that will not otherwise linger in the memory on Tyneside, with Graeme Souness' side toiling against their League Two third round opponents up to Shearer's 80th minute breakthrough.
It broke the hearts of Mansfield's 5,500 travelling fans, who had seen Peter Shirtliff's team more than match their Premiership hosts - and did nothing for under-pressure Souness' job security.
Attack-minded Mansfield created a couple of early openings, with former United schoolboy Adam Rundle crossing for captain Richie Barker with three minutes on the clock.
Then in the fifth minute Barker challenged goalkeeper Shay Given for a throughball, with defender Jean Alain Boumsong hesitant.
Three minutes later Nolberto Solano - playing an unfamiliar left-sided role - sent Albert Luque racing towards the byline, but with no-one in the box the Spain international could only shoot into the sidenetting.
Given parried an 18th minute shot from Allan Russell in the 18th minute, with an uncomfortable-looking Newcastle not having it all their own way against their opponents. Indeed, Shirtliff's side were playing the better football as the half wore on, with Durham-born Rundle always in the thick of the Stags attacks.
But United would have taken a 30th minute lead had it not been for defender Alex Baptiste blocking a goalbound Solano effort with Kevin Pressman - who had let in eight goals on his last visit to St James's Park as a Sheffield Wednesday player - helpless.
Charles N'Zogbia fizzed a left-foot shot over Pressman's bar in the 41st minute, but it was a rare effort from Newcastle and the game went into the half-time break goalless.
Souness' job looked to be hanging by a thread, as his concerned chairman Freddy Shepherd looked on from the Milburn Stand.
And less than a minute into the second half Rundle forced a good low save from Given with his first time shot after winger Gus Uhlenbeek crossed from the right.
In the 49th minute Stephen Carr - on his comeback from a two-and-a-half month lay off - flashed a shot over the Mansfield goal and Shearer looped a header into Pressman's hands in the 55th minute as Souness' side started to apply some pressure on their visitors.
Souness replaced Carr with Peter Ramage in the 58th minute and the United defender found himself up against a former team-mate in Rundle.
Michael Chopra was next on, replacing Martin Brittain and lining up alongside Shearer up front as Souness looked to find a way of unlocking the visiting defence.
Stags centre-halves Rhys Day and Baptiste were looking more comfortable than their Newcastle counterparts. To the continued dissatisfaction of most inside St James' Park, Souness' Premiership millionaires were running out of ideas while paupers Mansfield continued to threaten at the other end.
In the 72nd minute Luque curled a free-kick just over and Shirtliff replaced Russell with Adam Burchall.
Pressman stopped a near-post Chopra effort from a left-wing N'Zogbia cross a minute later, and the breakthrough finally came ten minutes from time thanks to Shearer, the United captain rifling home with his trusty right foot for his 200th Newcastle goal.
Newcastle: Alan Shearer - Was the best of a bad bunch for the Magpies and rescued a win with a record-equalling 200th goal for his hometown club.
Mansfield: Adam Rundle - The former Newcastle schoolboy proved to be a constant menace to a home defence who looked far from secure.