The Magpies started well, with Dan Burn testing goalkeeper Joan García with a shot on the turn from Malick Thiaw's knock-down, but in the sixth minute the hosts took the lead.
Brazilian winger Rafinha's finish was crisp and calm, but there was a touch of fortune about the build-up as Lewis Hall slipped as he looked to intercept a through ball from Lamine Yamal, who himself had profited from a Thiaw slip. Hall regained his footing, but couldn't cut out Fermín López's pass and Rafinha netted coolly.
But United responded superbly, and Anthony Elanga's equaliser just before the 15-minute mark was rich reward for their endeavour. Lewis Hall made it with a driving run down the left and a one-two with Harvey Barnes, and the left back's low cross was brilliantly rolled home by Elanga at the far post.
In the 18th minute, though, the visitors conceded again. Rafinha's free kick was headed back across goal by Gerard Martín, and Marc Bernal stroked beyond Aaron Ramsdale from close range to put Barça back in front.
Ronald Araújo glanced another Rafinha delivery, this time from a corner, into the sidenetting but before the half hour, the Magpies were back on level terms. Hall and Barnes were again involved, with the latter's cross just evading the former - but not Sweden international Elanga, who stole in at the far post again to grab his second of the night.
Seven minutes before the break, Eddie Howe's side felt aggrieved that they weren't awarded a penalty when Elanga - who was causing the hosts untold problems on the right flank - was pulled back by João Cancelo. At the other end, it took some magnificent defending from Burn to deny Robert Lewandowski; the Polish forward's first effort was blocked by the sliding Burn, before the England centre back got back up to beat Lewandowski to the rebound in the air.
On the stroke of half time, Barça squandered a glorious chance to go back in front. Aaron Ramsdale parried Rafinha's low drive with the loose ball narrowly evading Lewandowski. Yamal, though, looked certain to score as he ran onto it in the six-yard box - but somehow, he cleared the crossbar with most of the Camp Nou expecting the net to bulge.
But moments later, in stoppage time at the end of a truly chaotic half, Yamal did find the target, making it 3-2 from the spot. Kieran Trippier, captaining the Magpies, was adjudged to have pulled Rafinha down as he looked to latch on to López's low centre. The penalty was given after a VAR check by referee François Letexier, who initially waved away the home side's protests before revising his decision after going to the monitor to review it - and Yamal whipped a low spot-kick past Ramsdale to leave United chasing the game once more.
Trippier was replaced by Tino Livramento at the break, and Ramsdale twice denied Rafinha in the first five minutes of the second period. On 52 minutes, however, Hansi Flick's men moved further in front. Once more, Rafinha was the architect, playing a first-time through ball which split the United defence in half. From there, López's finish was well-placed and left Ramsdale with little chance as it nestled in the bottom right-hand corner.
And ten minutes into the second half, Lewandowski beat Livramento to nod his side's fifth of the evening beyond Ramsdale and leave Howe's charges with a real mountain to climb.
**Newcastle United:** Aaron Ramsdale, Kieran Trippier (Tino Livramento 46), Lewis Hall, Joelinton, Sandro Tonali, Anthony Gordon, Harvey Barnes, Malick Thiaw, Anthony Elanga, Dan Burn, Jacob Ramsey
**Subs not used:** Nick Pope, John Ruddy, Aidan Harris, Sven Botman, Yoane Wissa, Will Osula, Jacob Murphy, Nick Woltemade, Joe Willock, Alex Murphy, Sean Neave