Goals from Andriy Yarmolenko and Aaron Cresswell earned West Ham their second successive home win against Manchester United, who lost Marcus Rashford through injury in the second half.
Yarmolenko opened the scoring on the stroke of half-time, sending a low finish past David de Gea following patient build-up play involving Mark Noble and Felipe Anderson.
Cresswell sealed all three points for the Hammers in the second half with a superb free-kick into the top right-hand corner.
Chances were at a premium in a cagey first half at London Stadium, with Noble's deflected effort from Pablo Fornals' free-kick the closest either team came to a breakthrough before Yarmolenko's strike.
Juan Mata should have levelled for the visitors two minutes into the second half but failed to hit the target after connecting well with Andreas Pereira's low cross.
The result lifts West Ham above the Red Devils in the table, while Ole Gunnar Solskjaer's side remain three points off the top four and without an away league win since February.