Late goals from Shola Ameobi and younger brother Sammy sent Newcastle through to round three of the Capital One Cup at the expense of Morecambe.
Shola's deflected shot from 20 yards and Sammy's individual effort settled a contest in which the Premier League team were second best for long spells.
The League Two side impressed and had numerous chances to cause an upset.
Dan Gosling made two goal-line clearances, while Padraig Amond was denied twice by goalkeeper Rob Elliot.
Newcastle's late rally eased some of the pressure on Magpies boss Alan Pardew, who has had to deal with questions about his club's lack of transfer activity and the future of unsettled midfielder Yohan Cabaye in the early weeks of the season.
A first win of the campaign will be a relief to Pardew, although his side were made to work extremely hard for victory by a team three divisions below them.
Morecambe were dominant during a goalless first period and had their fair share of opportunities to take a deserved lead into the interval.
Pardew's first home cup tie for Newcastle
Newcastle will face Leeds at St James's Park in the Capital Cup third round which is boss Alan Pardew's first home cup tie since he took over in December 2010.
The visitors, who made eight changes from their weekend draw against West Ham, were twice indebted to Gosling, the former Everton midfielder clearing headers from Shrimps captain Mark Hughes and striker Amond off the line.
Newcastle attacks were rare, with Gael Bigirimana's free-kick forcing the only save of note from home keeper Barry Roche.
Shola Ameobi's half-time introduction almost brought immediate rewards, but after latching onto Gosling's defence-splitting pass, he blazed over from 18 yards with only Roche to beat.
A long-range shot from young defender Paul Dummett fizzed wide as the prospect of extra-time loomed, while Pardew turned to Hatem Ben Arfa to inject some life into a below-par Newcastle display.
It was the French international who teed up the elder of the Ameobi brothers to fire the visitors in front, and as the hosts pressed for an equaliser, the younger Ameobi broke clear and slotted underneath Roche from close range to secure Newcastle's place in the last 32, where they will host Championship outfit Leeds.
Morecambe manager Jim Bentley:
"We've given a good account of ourselves. We had a right good go and I'm proud of all the players. We played some good stuff and had the better chances and unfortunately didn't come in with a lead. It was a proper cup tie.
"You could say both sets of players wanted to win the game. Their subs [Shola Ameobi and Hatem Ben Arfa] have come on and affected the game but that's what you'd expect from Premier League footballers."
Newcastle manager Alan Pardew:
"I'm very pleased with the young players that I put in. Shola made a big difference when he came on and I thought we deserved to win it in the end. The club owe a big 'thank you' to the likes of Gael Bigirimana, Dan Gosling and Curtis Good to get us a win.
"It will raise everyone's spirits, even the first team. It will take a bit of pressure off them to get our first goals and our first win. Let's hope we can get a win on Saturday, and you'd have to say that would be a start we could accept. Four points from those three games is OK, but we've got to win on Saturday and that's what we'll try and do."
- 01 Roche
- 05 Hughes
- 06 Diagne
- 08 Wright
- 22 Parrish
- 10 Williams
- 16 Drummond (Mwasile - 87' )
- 17 Fleming Booked (Kenyon - 77' )
- 09 Sampson Booked
- 11 Ellison
- 27 Amond (Marshall - 57' )
- 25 Arestidou
- 03 Threlfall
- 15 McCready
- 04 Kenyon
- 14 Marshall
- 19 McGee
- 20 Mwasile
- 21 Elliot
- 13 Yanga-M'Biwa
- 26 Debuchy
- 33 Good
- 36 Dummett
- 15 Gosling
- 20 Bigirimana
- 22 Marveaux Booked (Sissoko - 88' )
- 28 Sa Ameobi
- 29 Vuckic (Sh Ameobi - 46' )
- 11 Gouffran (Ben Arfa - 71' )
- 42 Alnwick
- 03 Santon
- 44 Streete
- 07 Sissoko
- 08 Anita
- 10 Ben Arfa
- 23 Sh Ameobi