West Ham climbed up to fifth as goals from Angelo Ogbonna and Jarrod Bowen sank Aston Villa 2-1.
The Hammers rode their luck, though, as Villa equalised once through Jack Grealish and had the chance to snatch a point, only for Ollie Watkins to miss a penalty.
And in stoppage time Watkins had the ball in the net only for an ‘armpit offside’ to come to West Ham’s rescue via the Video Assistant Referee.
David Moyes’ side held on to climb above Manchester City, Manchester United, Villa, Everton, Wolves and Southampton in the table.
They took the lead with less than two minutes on the clock after forcing a corner when Tomas Soucek’s shot was deflected behind by Matt Targett.
Bowen swung in the cross and Italian centre-half Ogbonna was unmarked at the far post to nod in his first goal of the season.
Much had been made of the return of Michail Antonio to West Ham’s attack but it seems Moyes has goals from all over the pitch – their last nine had been scored by nine different players.
Villa had started sluggishly but gradually came to life and Ezri Konsa headed over before Conor Hourihane tested Lukasz Fabianski with a free-kick.
Grealish drew them level after 25 minutes as West Ham backed off the England midfielder before allowing him to bury his shot, with the aid of a deflection, from 20 yards.
With Antonio having little impact Moyes replaced him with Sebastien Haller and also sent on Said Benrahma at half-time.
And within 30 seconds Benrahma, the £30million signing from Brentford, crossed for Bowen to head West Ham into a 2-1 lead.
Villa could have equalised when Watkins crossed low into the path of Trezeguet but the forward’s finish was weak and Fabianski was able to make the save.
They should have equalised moments later after Declan Rice was adjudged to have tugged Trezeguet’s shirt in the area.
Trezeguet left the field with a nasty cut above the eye, a result of landing on Rice’s studs as he threw himself to the ground, but a nervous looking Watkins lifted his spot-kick against the crossbar.
Villa thought they had rescued a point when Watkins tapped in Targett’s cross in stoppage time, but VAR decided otherwise after lengthy deliberations and West Ham held out for a third straight win.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here