Tanguy Ndombele combined with Troy Parrott in the opening two minutes as Spurs had the first attack of the match, but David de Gea was on hand to collect before Chris Smalling had to head back to his goalkeeper under pressure from Harry Kane moments later.
United had the game's first attempt in the fourth minute, though, with Martial firing against the post from inside the Tottenham box after being released by Daniel James in a dangerous position.
Tottenham had a brilliant chance of their own in the 10th minute when Parrott fed Dele Alli inside the United box, but the England international saw his low strike beaten away by De Gea.
The fact that Alli picked up a yellow card for a late challenge on Scott McTominay in the 11th minute was an indication of the type of match that was underway in Shanghai.
The breakthrough arrived in the 21st minute, though, with Martial managing to squeeze the ball through the body of Gazzaniga after Andreas Pereira had found the Frenchman with a clever pass.
Tempers flared shortly after the goal following a late challenge from Moussa Sissoko on James, which brought a furious reaction from a number of United players, led by the incensed Young.
Two more bookings were to follow before the half-time interval, with Andreas Pereira carded for a late challenge on Kane and Japhet Tanganga having his name taken for a poor tackle on Mason Greenwood.
The final chance of the first half also fell to Ole Gunnar Solskjaer's side, with Paul Pogba's powerful drive just missing the Spurs post after James had again shown his work-rate by regaining the ball after a heavy touch.
Solskjaer changed his entire team at the interval, with Fred one of the players to enter for his first pre-season minutes. The Brazilian also had the first shot of the second period, sending one wide of Gazzaniga's goal from distance.
United lost Eric Bailly to an injury in the 55th minute, with the centre-back having to leave the field on a stretcher, which saw the Red Devils make their 12th change of the contest.
The tempo did not drop, though, and Fred forced a smart save from Gazzaniga just before the hour as United looked to add to Martial's goal from the first period.
Tottenham improved in the second period, though, and it did not come as much of a surprise when Mauricio Pochettino's side equalised. There was a huge slice of luck about the goal, with Lucas's shot taking a deflection off Luke Shaw before dropping into the back of the net.
Marcus Rashford chipped over the Spurs crossbar in the spell that followed, but the London side were very much on the front foot in the second half, with the additions of Lucas and Son making a huge difference.
United scored their second in the 80th minute, though, when Gomes combined with Juan Mata inside the Tottenham box before brilliantly slotting the ball into the bottom corner.
Rashford had the ball in the back of the Spurs net in the 84th minute, only for the offside flag to come to Tottenham's rescue as the capital outfit stayed in the contest.
Pochettino's side could not find a leveller, though, with Lucas missing their best chance in the final moments when he headed wide of the post from close range.
Next up for Spurs is a clash against Real Madrid in the semi-finals of the Audi Cup next Tuesday, while United will continue their preparations for the new season against Kristiansund in Oslo on the same day.
TOTTENHAM: Gazzaniga; Walker-Peters (Foyth 46'), Tanganga (Marsh 70'), Vertonghen (Alderweireld 46'), Georgiou (Roles 62'); Winks (Skipp 46'), Sissoko (White 62'), Ndombele (Lucas 46'), Alli (Eriksen 62'); Parrott (Lamela 46'), Kane (Son 46')
MANCHESTER UNITED FIRST-HALF XI: De Gea; Wan-Bissaka, Smalling, Rojo, Young; McTominay, Pogba; James, Andreas, Greenwood; Martial
MANCHESTER UNITED SECOND-HALF XI: Romero; Dalot, Bailly (Tuanzebe 56'), Lindelof, Shaw; Fred, Matic; Lingard, Gomes, Mata; Rashford