Felipe Anderson scored twice as West Ham overcame Burnley 4-2 in a pulsating game at the London Stadium.
Marko Arnautovic put the hosts in front after capitalising on James Tarkowski's mistake before Johann Gudmundsson equalised against the run of play on the stroke of half-time.
West Ham regained the lead as Anderson finished off a free-flowing move but Burnley pegged them back again as Robbie Brady set up fellow substitute Chris Wood for their second goal.
With six minutes remaining, Anderson's goal put West Ham in front for a third time and after Wood hit the bar, Javier Hernandez sealed the points in stoppage time with an emphatic finish.
West Ham: Fabianski (6), Zabaleta (6), Diop (6), Balbuena (6), Cresswell (6), Rice (7), Obiang (6), Snodgrass (6), Anderson (8), Diangana (8), Arnautovic (7)
Subs: Antonio (6), Hernandez (7), Ogbonna (N/A)
Burnley: Hart (7), Lowton (6), Tarkowski (5), Mee (7), Taylor (6), Gudmundsson (7), Defour (6), Westwood (7), Lennon (5), Vokes (5), Vydra (5)
Subs: Brady (7), Wood (7), Barnes (6)
Man of the match: Felipe Anderson
Manuel Pellegrini had labelled the game as 'must-win' and his side certainly started the game positively, with Arnautovic putting them in front on 11 minutes after robbing Tarkowski and then sliding the ball beyond his former teammate Joe Hart.
It was almost 2-0 to the hosts when Anderson's goal-bound effort was miraculously kept out by Ben Mee, while the lively Grady Diangana should have been awarded a penalty after a trip from Steven Defour. Instead, it was Burnley who got the game's second goal as Gudmundsson broke the offside trap and finished beyond Lukasz Fabianski after latching on to Ashley Westwood's defence-splitting pass.
West Ham continued to dominate after the restart and Anderson regained their lead with a fine finish on 68 minutes following good link-up play by Arnautovic and Diangana. Diangana was sent flying by a dreadful challenge from Tarkowski after he picked out Anderson and the England international was cautioned for the challenge, which perhaps warranted further punishment.
Manuel Pellegrini made three changes to the team that drew with Leicester last weekend. Pedro Obiang replaced the suspended Mark Noble in midfield while Aaron Cresswell and Mark Arnautovic were recalled for Arthur Masuaku and Javier Hernandez. Sean Dyche also named three changes as Aaron Lennon, Ashley Westwood and Matej Vydra came in for Robbie Brady, the injured Jack Cork and Jeff Hendrick.
The visitors showed their character again, though, by equalising 10 minutes later. Just two minutes after coming on, Brady whipped in a corner for Wood to head into the corner of the net.
A couple of minutes later, West Ham missed a gilt-edged chance to go in front for a third time when Anderson's curling strike kissed the far post. However, the Brazilian made amends shortly after when his shot took a huge deflection off Mee to leave Hart with no chance.
There was further drama when Wood - who scored twice in the corresponding fixture last season - saw a header crash off the bar but in the end, it was West Ham who grabbed the sixth and final goal of the game when Hernandez slammed a shot into the roof of the net after being picked out by Michail Antonio.
- West Ham have won six of their nine Premier League meetings with Burnley (D1 L2).
- Burnley have won just once in their last eight Premier League away games (D2 L5), losing four of the last five.
- Burnley have failed to keep a clean sheet in nine of their last 10 Premier League games, shipping at least twice in six of those contests.
- Felipe Anderson has netted more goals today (2) than he did in his first 10 Premier League appearances for West Ham (1). Anderson is the first Brazilian player to net a brace for West Ham in the Premier League.
- Burnley's Chris Wood has been directly involved in five goals in three Premier League games versus West Ham (4 goals, 1 assist).
- Since the start of last season, Johann Berg Gudmundsson has been directly involved in 16 Premier League goals (4 goals, 12 assists) - more than any other Burnley player.
- West Ham's Marko Arnautovic is now the highest goalscorer in all competitions at the London Stadium (9 goals).
- Only Jermain Defoe (24) and Olivier Giroud (19) have scored more goals as substitute in Premier League history than West Ham striker Javier Hernandez (17).
Notes for Southgate
Declan Rice seems to be growing in influence with each passing week and was impressive at the base of West Ham's midfield once again. Whether Gareth Southgate feels he needs him right now considering his similarities to Eric Dier, is another matter but he certainly looks a prospect, as does Grady Diangana. James Tarkowski, meanwhile, endured a torrid afternoon, making a costly mistake for West Ham's opener and he was fortunate to not see red for a wild challenge on Diangana in the build-up to West Ham's second goal.
Man of the match - Felipe Anderson
Grady Diangana ran him close, but Felipe Anderson's two goals proved to be the difference between the two teams on the day. In the build-up to the game, Manuel Pellegrini called on Anderson to show more, saying he was 'not happy' with the contribution of West Ham's record signing.
Those words certainly had the desired effect as Anderson was an influential figure from start to finish, scoring twice, hitting the post, forcing a remarkable goal-line save from Ben Mee and playing his part in the build-up to the fourth goal in stoppage time.
Anderson had 103 touches in total - 25 more than any other player on the pitch - which highlights his involvement in what was a crucial win for the club.
West Ham travel to the John Smith's Stadium to take on Huddersfield next Saturday while Burnley play a second consecutive away game against Leicester City at the King Power, also on Saturday.