Dwight Gayle back-heeled in the opener on 17 minutes, profiting after his first effort had been parried by goalkeeper Asmir Begovic.
And the former Crystal Palace man made it two in stoppage time at the end of the first period, stabbing home Ayoze Pérez’s powerful low centre after it eluded the Cherries stopper.
Adam Smith got one back for Bournemouth with just over ten minutes remaining, and with just two minutes left on the clock, Gosling completed the comeback, turning in Nathan Ake’s centre inside the box.
It was Gosling who squandered the game’s first sight of goal, heading the dangerous Junior Stanislas’ cross over the top.
With winger Stanislas at the heart of most of the hosts’ attacks, they posed an early threat. Martin Dúbravka – so impressive in his first game for Newcastle in that 1-0 win over Manchester United – had to be alert to palm away Callum Wilson’s shot after the ex-West Ham man’s cross fell kindly for him.
But, after Kenedy had fired a warning with a curling free kick, United seized the advantage just after the quarter hour mark. Jonjo Shelvey’s superb ball bypassed Charlie Daniels and released Matt Ritchie, whose low cross was dispatched by Gayle at the second attempt.
The goal lifted Rafa Benítez’s men, and Ritchie – twice a promotion winner during his time with the Cherries – almost made it two, curling just past Asmir Begovic’s right-hand post.
And though the visitors retained the upper hand after that opener, it took until the first half’s dying moments for them to deservedly extend their advantage. Cherries stopper Begovic failed to gather Pérez’s well-struck low cross-shot, which allowed Gayle to prod home his second of the afternoon from point-blank range.
A cagey start to the second period was punctuated by a Ryan Fraser effort – which flew past Dúbravka’s upright – and substitute Smith’s wayward drive. But Ritchie’s skidding shot from range reminded Bournemouth the Magpies still posed a threat, though on that occasion Begovic did well to hold it.
A frantic final 20 minutes saw former Cherries loanee Christian Atsu come off the bench to see his effort charged down by Nathan Ake, before Pérez poked over after Gayle’s free kick was blocked. Gayle was then withdrawn, with Isaac Hayden sent on in his place.
Just after Shelvey miscued when Atsu squared the ball across goal for him, Smith found the target from range, blasting home via the crossbar to set up a nail-biting final ten minutes.
And with just two minutes left, it was Gosling who completed the hosts’ comeback and denied the Magpies all three points, firing into the roof of the net to reward them for their late pressure.