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.
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."