Man United remained in fourth place with 63 points from 34 matches, one point ahead of Liverpool, who have played 35 games.
West Ham took their tally to 37 in 15th place, seven points ahead of the relegation zone.
The visitors had their best chances in the first half but paid the price for De Gea’s mistake.
Saeed Bin Rahma kicked in from midfield and hit a weak ball, which the Spanish keeper failed to stop, and it settled into the net.
West Ham demanded a penalty after a handball against Manchester United defender Victor Lindelof, but the video assistant referee confirmed the validity of the referee’s decision to play on.
De Gea saved a second-half Tomas Sochik chance, before the West Ham player hit the net with a header, but the referee ruled out the goal for offside in the 73rd minute.
West Ham goalkeeper Lukasz Fabianski saved two chances from Marcus Rashford and substitute Anthony Martial after the break.
Despite counting 10 minutes of stoppage time, United failed to redeem themselves, suffering a second league defeat in a row.
Read the Latest World News Today on The Eastern Herald.