Kevin Davies gave Bolton a Premier League lifeline but he will now miss Wanderers' next two games.
The hard-working striker scored a 46th minute winner but had enough chances to finish with at least a hat-trick.
However, a harsh booking - his 10th of the campaign-for a foul on John Paintsil means he will sit out the away games at Middlesbrough and Spurs.
At least he signed off by giving his team hope of beating the drop, but Wanderers, who hadn't won at home since January 2, are still in the mire.
But this was a badly-needed confidence boost after nine games without victory and it should go some way to appeasing the anti-Gary Megson, anti-Phil Gartside brigade.
There was a minor demonstration outside the ground before and after kick-off, but the majority of fans backed the team throughout a tense 90 minutes.
In contrast, West Ham's slide continues. This was their third successive defeat and only in flashes did they threaten to get back on terms.
Dean Ashton and Scott Parker went closest in the second half, but Ali Al-Habsi made two great saves.
Bolton should have been ahead at the break. El Hadji Diouf had a goal controversially disallowed for offside six minutes from half-time.
Andy O'Brien's header from Ivan Campo's free-kick seemed destined to cross the line anyway before the Senegal striker stuck his toe to the ball.
And the touch proved crucial as the former African Footballer of the Year was flagged offside.
Megson was predictably incandescent with rage though Davies and Diouf might fractionally have strayed too far.
Davies also had a header cleared off the line by Parker while Jonathan Spector also denied the Wanderers target man in similar fashion after just six minutes.
Davies finally got his reward just 50 seconds into the second period. Robert Green initially denied the ex-Blackburn forward at the expense of a corner.
But Spector impeded Green as he came to collect Matty Taylor's corner and Davies gleefully smashed the ball into the net from four yards for just his third league goal of the campaign.
With the pleasure went pain though and Davies had to briefly leave the field with a finger injury.
However, it takes harder blows to knock Davies off his game and he soon returned to the fray.
Anaemic West Ham needed a transfusion of energy and Carlton Cole's appearance for Jack Collison brought about a reaction.
'You don't know what you're doing' taunted Hammers fans to boss Alan Curbishley.
But within minutes Gary Cahill cleared Luis Boa Morte's left-footer off the line while Al-Habsi tipped Ashton's overhead effort on to the bar and away for a corner.
Parker's shot was also bound for the net, but Bolton held on and move on to the Riverside to face Middlesbrough as they bid to stay up.