Townsend, who spent the second half of the 2015/16 campaign at St. James' Park, nodded home 25 minutes into the contest at Kenilworth Road.
And despite plenty of second half pressure from Eddie Howe's side, and a disallowed goal from substitute Alexander Isak, the Hatters held on to record their first Premier League clean sheet of the season and frustrate the Magpies.
Jacob Brown tested Martin Dúbravka early on, just before supporters from both sides joined a warm ovation for Hatters skipper Tom Lockyer - who suffered a cardiac arrest in Luton's game at Bournemouth last weekend - when the clock hit four minutes.
And while it was Rob Edwards' men who looked liveliest in the opening exchanges, Howe's men grew into the contest as they began to see more of the ball. When Lewis Miley's effort from Sean Longstaff's cross was blocked, Callum Wilson glanced just wide. A few minutes later, the Magpies' frontman had an even better opportunity, seeing his close-range header from Anthony Gordon's cross brilliantly kept out by goalkeeper Thomas Kaminski.
But just after the midway point in the first period, those misses began to look costly. Alfie Doughty's corner was flicked on in the box by Ross Barkley and ex-United wideman Townsend was in the right place at the right time to nod home from close range against his former employers.
It could have got even worse for United ten minutes before the break. Barkley took aim from 30 yards and almost registered a stunning second for his side, but the ball crashed off the woodwork and Martin Dúbravka eventually clutched it, perhaps grateful that it rebound off his back and into the net. Moments later, the influential Barkley played in Elijah Adebayo, who was denied by the Slovakian's foot as the hosts rallied.
Newcastle captain Jamaal Lascelles was then wihdrawn with what looked like an injury, with Sven Botman summoned from the bench along with Isak, who replaced Miley with 37 minutes on the clock.
But while Isak's guile threatened to add a different dimension to United's attack, Luton kept coming back for more as they sought another goal. Just after the restart, it was Brown's turn to try his luck again, and once more the crossbar prevented Howe's side from falling further behind as his left-footed effort crashed against it.
Bruno Guimarães had a sight of goal soon after that but couldn't hit the target and Gordon then hit the sidenetting from Kieran Trippier's cross to the near post as the visitors raised their intensity in the second half. That culminated in Isak finding the target, arrowing a shot across Kaminski just after the hour mark after a neat through ball from Miguel Almirón, but after a VAR check the goal was chalked off for offside.
Guimarães forced a near-post stop from Kaminski with 20 minutes left as Howe's men continued to push but despite it being one-way traffic late on, a leveller wasn't forthcoming on what was a disappointing afternoon for Newcastle and their travelling supporters. Luton could even have netted again in the closing stages, when Barkley's fizzing drive whistled past the post.