Jose Mourinho dropped Alexis Sanchez from his squad for the game, but Paul Pogba started at London Stadium after their training ground row earlier this week.
United made the worst possible start, with West Ham's record signing Felipe Anderson getting a deft touch on Pablo Zabaleta's low cross to score his first for the club, giving them the lead less than five minutes into the game.
Replays showed that Zabaleta was offside when Mark Noble's initial pass came to him, but the goal stood without protest.
Romelu Lukaku nearly levelled for United midway through the first half when his header from Ashley Young's cross struck the outside of Lukasz Fabianski's post.
The away side continued to load the box in search of an equaliser, but their hosts held firm, easily dealing with several crosses.
While United began to steadily build, they never threatened to score, and were made to pay when West Ham went 2-0 up just before half-time.
The ball fell to Andriy Yarmolenko from a West Ham corner, and his speculative effort from the edge of the area looped in following a deflection off Victor Lindelof.
United to continued to look wide in search of a goal after the break, with Mourinho bringing on Marcus Rashford for Lindelof, but still they failed to threaten West Ham's lead.
Shortly after the hour mark, United finally went close to pulling one back, but Marouane Fellaini's header was well saved by Fabianski.
Rashford finally managed to grab a goal for United after 71 minutes -- seconds after Pogba and Anthony Martial were taken off -- with a flick at the near post from Luke Shaw's corner.
However, United's relief was short-lived as West Ham went 3-1 up just three minutes later.
Noble was given time and space in midfield to break forward and play a through ball to Marko Arnautovic, who was given even more freedom to run in behind the United defence to slot the ball under David De Gea to seal the win.
West Ham are now unbeaten in four games in all competitions, while United failed to win for the third time in a week.