Angelo Ogbonna and Jarrod Bowen were both on target for David Moyes’ side, who fought back after a deflected Jack Grealish equaliser and were fortunate that Ollie Watkins smashed a late penalty against the crossbar before seeing a stoppage-time effort ruled out for offside in a lively encounter on Monday night.
The hosts - boosted by the return of key forward Michail Antonio following a hamstring injury - could not have made a better start to proceedings in Stratford, with Ogbonna towering high at a corner to head home West Ham’s fastest Premier League goal since November 2016 with only one minute and 50 seconds on the clock.
However, they failed to push on from there, with Villa recovering from a sleepy start as Trezeguet’s effort was deflected wide, Ezri Konsa headed over and Conor Hourihane - in for the injured Ross Barkley - saw a free-kick pushed around the post by Lukasz Fabianski.
The equaliser came after 25 minutes, when Grealish - quiet out on the flank - drifted inside and saw a hopeful shot take a huge deflection off Ogbonna on its way in.
Villa largely controlled the tempo of the first half thereafter, with Watkins shooting wide after an eye-catching passing move and Hourihane curling another left-footed free-kick into the side netting.
Unimpressed with that first-half decline, Moyes made two decisive changes at the break as the ineffective Antonio and Arthur Masuaku were replaced by Sebastien Haller and Said Benrahma respectively.
And within 30 seconds that intervention paid off, with the former Brentford winger crossing for Bowen to head in and catch Villa cold once more.
The visitors attempted to hit back immediately as Grealish teed up John McGinn for a low strike that was blocked by Aaron Cresswell.
Tempers flared after a foul on Grealish that brought yellow cards for Pablo Fornals and a coach from each side, including Villa assistant John Terry.
Dean Smith’s men - who had not conceded a goal on the road in the league in 2020/21 before Monday night - should have pulled level again when Watkins laid the ball on a plate for Trezeguet, whose close-range finish lacked conviction and was saved by Fabianski.
Fabianski then held a strike from Konsa and Watkins headed over after a sublime piece of Grealish skill in a tight space that left three West Ham players scratching their heads.
Rice foolishly gave away a penalty with under 20 minutes remaining when he tugged the shirt of Trezeguet inside the box as the Egyptian tried to collect a flick-on from Douglas Luiz. He breathed a sigh of relief as Watkins thundered against the woodwork.
Substitute Bertrand Traore tested Fabianski from range before Watkins’ miserable night was compounded after he sidefooted home a brilliant Matt Targett cross, only to be denied by the narrowest of offside calls after a lengthy VAR review.