Substitute Lingard fired a powerful shot into the top corner against his ex-club in the 89th minute, but West Ham received a handball penalty from defender Luke Shaw shortly afterwards.
Mark Noble stepped up to take the penalty immediately after coming off the bench, but De Gea guessed correctly and dived to save his penalty.
West Ham had taken the lead after half an hour with a deflected shot from Said Benrahma, but the guests reacted five minutes later with Cristiano Ronaldo headed a Bruno Fernandes cross to Lukasz Fabianksi and shot the ball into the net.
It was Ronaldo’s fourth goal in three games after scoring twice in his second debut for the club against Newcastle United and once in Tuesday’s 2-1 Champions League defeat at Young Boys.
The Portuguese had a chance in the second half before Lingard’s goal when he was again brought in by Portugal’s team-mate Fernandes, but Fabianksi thwarted the attempt with his legs.
Ronaldo was also denied a penalty after a foul by Vladimir Coufal.
Manchester United are second in the Premier League with 13 points from five games, while West Ham have eight points after their first loss of the season.
“Beer maven. Creator. Tv fanatic. Internet scholar. Award-winning web junkie. Avid alcohol expert. Friendly writer. Gamer.”