Trevor Sinclair's 76th minute winner kept West Ham's wafer-thin survival chances alive.
But the Eastenders still find themselves hovering precariously over the relegation trap door and they still have it all to do if they are to escape the hangman's noose.
"The boys have hardened up to life at the bottom of the table," insisted Glenn Roeder. "After Saturday it was a thoroughly deserved three points. I told them it was so important to show controlled aggression and to finish with 11 men.
"We needed them to keep their heads and they have shown great mental toughness." The theme tune from The Great Escape blasted around Upton Park prior to the kick-off but, in truth, Mission Impossible would have been a more appropriate serenade for a Hammers side starting out six points adrift of 17th placed Bolton Wanderers.
Cutting to their tiny glimmer of hope Joe Cole and Sinclair soon unleashed stinging shots that Mark Schwarzer could only parry.
And as an agitated affair became increasingly niggly, Jermain Defoe almost opened the scoring on 33 minutes with an audacious lofted back-heel that the alert Boro keeper did well to hold.
At the other end, David James was forced to tip over Tomas Repka's woefully sliced clearance before Cole broke away from inside his own half and drilled wide under pressure from his pursuers.
Right on half time, West Ham were fortunate to survive a goalmouth scramble who after James could only parry Juninho's awkward free-kick.
Boro shrugged off the loss of their Brazilian at the break and indeed on the hour Gareth Southgate sidefooted inches wide.
West Ham continued to press too. Steve Lomas' overhead kick crashed off Schwarzer's left-hand post before a chorus of boos greeted Roeder when he emerged from the dugout for the first time with just 15 minutes remaining.
But within seconds Sinclair had turned the jeers to cheers when he swept in Glen Johnson's low right-wing cross from 15 yards.
"West Ham took the defining moment that came about in the game," said an angry Steve McClaren. "Credit to them, but we fell way below the standards that we set ourselves."