Massimo Maccarone came off the bench to claim a narrow win for Middlesbrough.
This was Boro's fourth home win of the season
The Italian had only been on the pitch for five minutes, but he reacted quickly to take the ball around Robert Green and fire into the empty net.
Boro were just about worth the win in a error-ridden match, which saw West Ham take nearly an hour to win a corner.
Aiyegbeni Yakubu had Boro's best chances in the first-half as the Nigerian twice threatened following huge clearances from Mark Schwarzer.
606 DEBATE: Give your thoughts on this match
Last season Maccarone came off the bench to spectacular effect in Boro's Uefa Cup run helping them reach the final, notably in the games against Basle and Steaua Bucharest.
And the Italian's speed of thought and feet proved decisive as Boro returned to winning ways after defeats to Manchester City and Watford.
Speed of thought and action had been two qualities palpably absent in the preceding 70 minutes as these under-confident sides produced nervous performances as they struggle to move up the table.
Jonathan Spector and Fabio Rochemback gave a foretaste of what would prove to be an instantly forgettable first-half, hoofing shots embarrassingly over the bar.
Boro fielded just one striker in Yakubu, who to his credit was one of the few players prepared to put his foot on the ball and attempt to bring a degree of creativity to the proceedings.
Yakubu proved a willing runner and twice almost successfully chased down two huge clearances from goalkeeper Schwarzer.
Green came to collect the first of those clearances, while a well timed tackle from Danny Gabbidon took the ball away from the Nigerian striker on the second occasion.
Just past the half-hour Stewart Downing's initiative ensured the game had its first save as Green palmed the England winger's shot away for a corner.
West Ham had opted to deploy two forwards, but with the visitors outnumbered in midfield, Marlon Harewood and Teddy Sheringham struggled with the limited possession they received.
The only occasion Schwarzer had cause for concern in the opening 45 minutes was when Jonathan Woodgate sliced clear Nigel Reo-Coker's cross.
Rochemback provided a more positive start to the second-half, striking an elegant half-volley that went narrowly wide.
Just before the hour West Ham manager Alan Pardew tried to pep up the visitors' attack, replacing Harewood with Carlos Tevez.
Twice the Argentine forward got himself into good positions, only to fatally delay his shots.
But it was Boro who continued to look the more likely side to score and so it proved as Maccarone cleverly carried the ball round Green before turning his shot home from an acute angle.
Middlesbrough manager Gareth Southgate:
"It was a day when we felt we needed to be solid and try to pinch something.
"I'm not going to sit here and say it was enjoyable to watch, but sometimes when you're on the back of two defeats, it's important you show character.
"It was a big win for us and we didn't give them too many opportunities."
West Ham manager Alan Pardew:
"The one break in the game fell for them and unfortunately for us, they took it.
"It was a really tight game. They were obviously a little bit nervous.
"The disappointing thing - apart from the result - was the last 10 minutes when we looked like we were rushing things when we needed to be patient."
Middlesbrough: Schwarzer, Davies, Woodgate, Pogatetz, Taylor, Morrison, Cattermole, Rochemback (Maccarone 69), Boateng, Downing (Huth 90), Yakubu.
Subs Not Used: Jones, Mendieta, Euell.
Goals: Maccarone 74.
West Ham: Green, Spector, Collins, Gabbidon, Konchesky, Benayoun (Cole 82), Mullins, Reo-Coker, Etherington, Sheringham, Harewood (Tevez 62).
Subs Not Used: Carroll, McCartney, Mascherano.
Booked: Collins, Spector, Benayoun.
Ref: M Halsey (Lancashire).