Lingard, who enjoyed a loan spell at West Ham last season, came off the bench to grab the winner with a minute remaining.
The result sees United climb to second place in the table, while David Moyes' team are in eighth position.
"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."
Before kickoff, both sets of players, coaches and supporters gave a minute's applause in memory of former West Ham and England striker Jimmy Greaves, who died on Sunday at age 81.
A minute later, West Ham went up the other end and opened the scoring after Benrahma's shot from outside of the box deflected in off Raphael Varane.
It only took five minutes for United to grab an equaliser when Ronaldo tapped home from close range after Fabianski had spilled his initial flick from Fernandes' cross.
Both sides had good chances to go ahead before the break but Fabianski saved from Ronaldo while Nikola Vlasic missed the target from inside the area.
Ronaldo almost grabbed his second a minute into the second half but Fabianski raced out and denied him with a great save.
However, with a minute remaining, Lingard stepped up with a stunning curling strike to put the visitors ahead.
But in stoppage time, West Ham were awarded a penalty after a VAR review when the ball struck Luke Shaw's hand inside the box.
Noble was brought on to take the penalty, but his spot kick was saved from De Gea to rescue the three points for United.
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," Lingard said. "I got a brilliant reception. I had a good time here, but I have to move on with Man United and do my best."