Brentford delivered a huge blow to West Ham's top-four hopes as the Bees moved further clear of the relegation places with victory in west London.
Second-half goals from Bryan Mbeumo and Ivan Toney saw Thomas Frank's side climb to 13th in the table, 12 points clear of the bottom three, to all but confirm their Premier League safety.
Mbeumo fired in from Toney's pass shortly after half-time, before turning provider for his team-mate as Toney headed in after 64 minutes.
"I'm very proud. It was a top performance against a very good side who are in the quarter-final of the Europa League and fighting for a Champions League spot," said manager Frank.
"It was close to a complete performance. The way we did it shows how far we've come. It's a combination of a top performance and a good win."
He added: "Of course I looked at the table, but I want to focus on the next game."
The hosts had appeared the more likely to break the deadlock before half-time, but the heavily involved Mbeumo headed at Lukasz Fabianski and also saw a powerful strike pushed away by the West Ham goalkeeper.
The visitors managed only one shot on target - a first-half Tomas Soucek header - in a subdued display, while Kurt Zouma was forced off early with an ankle problem ahead of Thursday's Europa League quarter-final second leg in Lyon.
The Hammers remain sixth, six points adrift of fourth-placed Tottenham in the race for Champions League football, having also played a game more than Spurs.
There was no shortage of motivation for West Ham, after defeats for fellow top-four hopefuls Arsenal and Manchester United on Saturday left the fight for the European positions wide open.
But, with the game falling between two huge meetings with Lyon, the Hammers struggled against a Brentford side full of confidence following their memorable 4-1 win over Chelsea last week.
Instead, it was the hosts who maintained their fine form at the end of their first Premier League season, deservedly securing a fourth win in five league games.
That upturn in results has coincided with the signing of Christian Eriksen, who once again produced a superb midfield display to offer the base for Brentford's superior attacking output.
The hosts had been by far the more fluent in the final third in the opening 45 minutes, recording nine shots to the Hammers' two, but Mbeumo in particular was unable to capitalise with any of his five attempts.
No complaints with West Ham loss - Moyes
They made their chances count in the second half, though, as the 22-year-old Mbeumo seized his first opportunity after the restart, before his looping cross allowed Toney to put the game beyond West Ham.
David Moyes called on Said Benrahma and Nikola Vlasic from the bench in the hope of inspiring a fightback, with Benrahma seeing a deflected effort drop on to the roof of the net.
Brentford had further chances to extend their advantage too, Mbeumo notably shooting over at close range, but their misses did not prove costly as another excellent result was secured.
It is now all eyes on Lyon for West Ham, who must rest up and regroup quickly as they attempt to reach the club's first European semi-final since 1976.
"I don't have any complaints at all, we weren't really at it from the start," said West Ham boss Moyes.
"There are mitigating circumstances. We had a tough game on Thursday and the Thursday-Sunday schedule is not ideal. For the most part this season we've been very good but today felt like one too many."