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.
The Magpies eased themselves seven points clear of the drop zone as a result of their 1-0 win, leaving the visitors four points behind and still with work to do.
Town started in positive mood, with Alex Pritchard dragging a third-minute effort from distance well wide, but the Magpies soon settled to press them back.
Jonjo Shelvey drilled a seventh-minute free-kick straight at the defensive wall, and the Magpies were appealing in vain for a penalty seconds later after Kenedy went to ground inside the box.
Shelvey came much closer after Gayle's overhead effort had been blocked six minutes later, seeing his effort fly just wide after it sped through a crowded penalty area, and Ritchie was denied one-on-one by keeper Jonas Lossl two minutes later after bursting into the box.
Gayle saw a long-range effort easily fielded by Lossl, but opposite number Martin Dubravka needed the help of Jamaal Lascelles when Tommy Smith drilled a 28th-minute ball across the face of goal.
However, Newcastle came desperately close to taking the lead seconds later when Gayle ran on to Shelvey's quickly-taken free-kick and lifted the ball over the advancing Lossl, but agonisingly wide of the target.
The Newcastle striker perhaps should have done better five minutes later when he controlled DeAndre Yedlin's driven cross, but poked his shot over the bar.
Perez's clever flick from Yedlin's deflected cross flew across the six-yard box three minutes before the break, but no black and white shirt was on hand to make contact with the goal yawning.
Shelvey wasted a promising opening within seconds of the restart when he sliced his shot horribly wide after Perez, Kenedy and Gayle had launched a counter-attack, although the game became increasingly scrappy as the half unfolded.
Huddersfield mustered their first real attempt on goal with 59 minutes gone when striker Laurent Depoitre turned Lascelles and drilled a low attempt just wide, and they started to come into the game as an attacking force.
Indeed, the Magpies survived a 65th-minute goalmouth scramble after they failed to deal with Aaron Mooy's right-wing corner and allowed defender Mathias Jorgensen to head towards goal.
Substitute Christian Atsu blazed a shot high and wide as the home side struggled for inspiration, but it was from his cross that the Magpies finally forced their way in front with 10 minutes remaining.
Lossl got a hand to the ball, but could only help it on to Kenedy beyond the far post, and he squared unselfishly for Perez to snatch a priceless victory.