The Red Devils had plenty of the ball during another dreary performance, but Longstaff's 72nd-minute strike saw Steve Bruce's side pick up a huge three points against their out-of-form visitors.
The result has moved Newcastle onto eight points - just one point behind 12th-placed United, who have made their worst start to a top-flight campaign for 30 years.
Newcastle had a half-chance inside the first minute when a dangerous pass released Miguel Almiron inside the United box, but Ashley Young did excellently on the back foot to block the attacker's attempt.
Another hint of an opportunity arrived in the 11th minute when Joelinton won a flick on against Axel Tuanzebe, but David de Gea was sharp off his line to prevent Allan Saint-Maximin from reaching the ball.
Saint-Maximin then struck wide of the post from distance with Bruce's side making the running against a United side that were sluggish once again in the early exchanges.
Matty Longstaff - playing alongside his brother Sean in central midfield - had first real attempt of the game in the 28th minute, but the young midfielder saw his thunderous strike clip the top of De Gea's crossbar.
Fabian Schar then headed just over the United goal minutes later with the home side threatening to make the breakthrough against a lacklustre Red Devils outfit.
Almiron had a golden chance to send Newcastle ahead in the 39th minute after breaking into the United box, only for Harry Maguire to come across at the final moment and make a huge block.
The away side's first shot on target arrived in the 41st minute when Andreas Pereira hit one from distance, but the attacker's effort never had enough direction to trouble Martin Dubravka between the sticks.
United had an incredible opportunity to make the breakthrough on the stroke of half time when Maguire met an brilliant corner from Young, but the England international somehow nodded wide from close range.
Almiron fired wide of the post in the early stages of the second period as Newcastle started the brighter, although Mata was playing much closer to Rashford with United seemingly looked to be more proactive.
Andy Carroll came off the Newcastle bench in the 56th minute - replacing the ineffective Joelinton, who struggled to get the better of Tuanzebe at the heart of the United defence.
The visitors had a half-chance just before the hour when Pereira delivered a glorious cross towards James at the far post, but the Wales international just could not reach the ball.
The alterations certainly helped Solskjaer's side in the final third, and only a brilliant interception from Schar prevented Rashford from having a free shot on goal from a James cross.
Newcastle took the lead on the counter-attack in the 72nd minute, however, when Jetro Willems managed to poke a pass into Matty Longstaff, who picked out the back of the net with a fine finish on his Premier League debut.
United had a lot of the ball in the period that followed, but aside from a long-range strike from Fred, not too much was happening for the visitors in terms of a response - that pattern continued into the final exchanges, and Ole Gunnar Solskjaer's side could not find a leveller as their awful start to the campaign continued.
Next up for Newcastle is a trip to Chelsea, while United's search for a league win will continue at home to runaway leaders Liverpool after the international break.
NEWCASTLE UNITED (3-4-3): Dubravka; Schar, Lascelles, Clark; Yedlin, M Longstaff, S Longstaff, Willems; Almiron (Krafth 90'), Joelinton (Carroll 56'), Saint-Maximin (Atsu 82')
MANCHESTER UNITED (4-3-3): De Gea; Dalot (Rojo 60'), Tuanzebe, Maguire, Young (Chong 86'); Fred, McTominay; Andreas, Mata (Greenwood 66'), James; Rashfordbody check tags ::