West Ham had gone ahead on the half-hour mark with a deflected strike from Said Benrahma but the visitors responded quickly, Cristiano Ronaldo heading a Bruno Fernandes cross at Lukasz Fabianksi and following up to tap the ball into the net.
Substitute Lingard hit a thumping shot into the top corner in the 89th minute against his former club but West Ham were awarded a penalty moments later for a handball by defender Luke Shaw.
Mark Noble stepped up to take the penalty immediately after coming off the bench but De Gea guessed correctly and dived to turn his spot-kick away.
Manchester United are second in the Premier League standings with 13 points from five games while West Ham are eighth after suffering their first defeat of the season.
It was the first time De Gea had kept out a penalty since April 2016, having let in the previous 40 spot-kicks he had faced including 11 in the shootout in last season's Europa League final loss to Villarreal.
"It was the last minute, I made the save. Going through my head was 'save the ball'. It's a massive three points for us," De Gea said.
"It was a really tough game, both teams had good chances, again a great goal from Jesse. In the dressing room we said the three points were the most important thing."
There was also a sense of redemption for Lingard, whose stray pass had given away Young Boys' last-gasp winner in the Champions League on Tuesday.
"Mistakes happen in football, you have to overcome those things," said Lingard, who scored nine Premier League goals for West Ham last season after joining on loan.
"I got a brilliant reception. I had a good time here but I have to move on with Man United and do my best," he added.
Both sides showed signs of tiredness after their European exploits, with West Ham winning 2-0 on Thursday in their opening Europa League game away to Dinamo Zagreb.
David Moyes's side took the lead when Algerian midfielder Benrahma tried his luck from the edge of the area and his shot flew into the net off the back of Raphael Varane.
But the visitors responded strongly and levelled when Ronaldo struck a fourth goal in three games since returning to Manchester United, netting twice against Newcastle United and once in the 2-1 defeat at Young Boys.
The Portuguese had another chance in the second half before Lingard's strike when he was again played in by Portugal team mate Fernandes but Fabianksi thwarted the attempt with his legs.