West Ham leapfrogged over QPR after Marlon Harwood followed up his first-half penalty with a scorching late strike to give the East Enders a 2-1 victory that lifted them up into fifth place in the Championship.
Having lost at Loftus Road just three weeks ago, the in-form west Londoners were the last team West Ham wanted to be facing on the back of last Saturday's disappointing draw at Plymouth Argyle and a dismal 4-1 defeat at Cardiff City in midweek.
And Alan Pardew's worst nightmares could have become reality inside the opening five minutes when Jamie Cureton burst clear and fed the unmarked Paul Furlong who wastefully side-footed his casual 15-yarder straight to the exposed Stephen Bywater.
That let off spurred the Hammers into action as Harewood's angled 12-yarder was beaten out by Chris Day, who then saw Frankie Simek nod Carl Fletcher's follow up off the line.
As the quarter-hour mark approached, the Rangers keeper was again in defiant mood as he foiled Matthew Etherington's 18-yard effort.
While West Ham were clearly on the up, things were going downhill for Rangers who then saw Tony Thorpe forced to retire after half an hour following a reckless tackle by the consequently booked Tomas Repka.
Making a rare start, stand-in striker Don Hutchison then turned George Santos inside out before curling inches wide from 15 yards and, ten minutes before the interval, the inevitable breakthrough finally came.
When Luke Chadwick was dragged down by Danny Shittu as he galloped into the QPR box, Harewood sent the resultant spot-kick wide of the unlucky Day's outstretched arm and into the bottom corner to give Hammers a deserved half-time lead.
The first period had finished with a yellow card for Hutchison for his late challenge on Simek who was, in turn, then cautioned for scything through Etherington and the lively tempo looked set to prevail straight after the restart, too, as Harewood found himself clear before firing wildly across goal.
Curiously though, the winds of fortune then looked set to blow towards the west Londoners as the alert Bywater acrobatically palmed away Kevin Gallen's blistering 20-yarder before substitute Gareth Ainsworth saw his close-range header saved.
However, it was fellow substitute Kevin McLeod who looked to have saved Rangers on 72 minutes when he prodded home the equaliser at the far post after Shittu headed on Marc Bircham's long throw into the Hammers area.
But there was still time for there to be a sting in tail of this venomous London derby.
And with just seven minutes left, Chris Powell – who had earlier been booked for fouling Cureton – drilled across goal where substitute Bobby Zamora's clever dummy made the space for Harewood to crash home an angled winner from ten yards to claim his ninth goal of the season and a precious victory for West Ham.