Ayoze Perez fired Newcastle to the brink of Premier League safety as his fifth goal of the season arrived in the nick of time against Huddersfield.
The Spaniard slid home Kenedy's 80th-minute cross to finally break the deadlock on a tense afternoon at St James' Park, much to the relief of the bulk of a crowd of 52,261.
Dwight Gayle and Matt Ritchie had earlier passed up good opportunities to give their side the lead, but on a day when loan signing Islam Slimani belatedly made his debut as a substitute, the drama came amid a tense conclusion.