Winston Reid was the Hammers' unlikely hero on Saturday as the league leaders sank their derby rivals Millwall.
The New Zealand defender hit only his second goal for the club moments after Liam Trotter had cancelled out Carlton Cole's first-half header.
The drama came after Hammers skipper Kevin Nolan was shown a straight red card for a nasty two-footed lunge on Jack Smith with just nine minutes on the clock.
Happily there was no repeat of the crowd trouble which marred the last meeting between these old foes at Upton Park, in the Carling Cup in August 2009.
Nevertheless, the derby-day atmosphere clearly got to Nolan as his rush of blood left his team-mates to play more than 80 minutes a man down.
The Hammers shipped five goals in a shock defeat at Ipswich on Tuesday night and were desperate to get back to winning ways to cement their place at the top.
So the last thing they needed was to see their captain and most experienced player given his marching orders after just nine minutes..
Nolan may have got some of the ball, but he also got a lot of Smith and both his feet were off the ground as he slid in, giving referee Mick Jones no choice but to brandish the red card.
The home side had looked jittery even before Nolan trudged off, with Rob Green fumbling a deflected shot for a corner which Alan Dunne headed narrowly wide in the opening 25 seconds.
Green also had to save bravely at the feet of Darius Henderson, but the 10 men improved as the first half wore on and took the lead in stoppage time with Cole's ninth goal of the season.
Mark Noble floated in a free-kick, Reid's back-header looped high into the air and Cole rose above his marker to nod past David Forde.
They were inches away from going 2-0 up four minutes into the second half when Julien Faubert's header from George McCartney's cross beat Forde but came back off the crossbar.
Instead, they were pegged back in the 65th minute when Abdoulaye Faye tried to let the ball roll out for a goal-kick and was robbed by Henderson, who chipped it back for Trotter to lash home a fine volley from 15 yards.
But Millwall were level for just two minutes before Reid popped up to grab the winner.
Forde felt he was fouled by Faubert as he punched Joey O'Brien's up and under, but play continued and when the ball fell to Reid 20 yards out, the centre-half finished like a striker with a superb first-time shot past the floored Lions keeper and into the net.