West Ham manager Alan Curbishley was entitled to celebrate after his struggling side moved off the foot of the table by ending a run of five straight league defeats.
But it needed a controversial goal from substitute Bobby Zamora to secure the points and their first away win on the road in the league this season.
Referee Howard Webb ruled that his effort 15 minutes from time had crossed the line.
TV replays failed to back the official's decision and Carlos Tevez appeared to be in an offside position but Webb awarded the goal.
It was just the break the Hammers needed after Tevez's penalty had cancelled out the opener from Blackburn's Christopher Samba.
There were one or two encouraging signs for West Ham in the first half after one win in 12 league games.
In fact Tevez could have put them ahead in the first minute when he rattled in a shot from 20 yards.
American goalkeeper Brad Friedel made a good block from the Argentinian.
And Marlow Harewood perhaps should have made the breakthrough in the 27th minute when he was released by Tevez.
Blackburn were caught napping but Harewood showed a lack of confidence to direct his shot from inside the area wide of the post.
But those two moments apart in the first 45 minutes it was a case of backs to the wall for the Hammers.
And defender Lucas Neill had to endure the taunts of some Blackburn supporters following his move to Upton Park in the January transfer window.
He was forced to put in a hard shift as Blackburn pressed forward in numbers.
Matt Derbyshire found the net for Blackburn in the ninth minute but his effort was ruled out for an infringement.
Benni McCarthy then skipped away from Robert Green, only for the goalkeeper to recover and clear the ball over the bar.
Blackburn kept up the pressure and Morten Gamst Pedersen swung in a deep cross but Derbyshire was unable to get a vital touch.
David Dunn and Pedersen came close to putting the home side in front and David Bentley saw his delicate chip turned away by Green.
Then just before half-time Pedersen sent his shot wide from close range after Derbyshire had flicked the ball on.
Blackburn needed only two minutes of the second half to make the breakthrough and it came from an unlikely source.
Samba got away from his marker to flick a header beyond Green following a corner from Pedersen.
It was the defender's first goal for the club following his arrival from Hertha Berlin in January and you had to wonder how he managed to make that much space for himself.
But there was no hiding his delight and the fans broke into a cry of 'Let's all do the Samba'.
Curbishley decided to freshen things up in the 56th minute and brought on Zamora for the ineffective Harewood.
It proved to be an inspired move and could yet see the Hammers move out of trouble.
However Mark Hughes' side continued to hold the advantage and maintain the majority of possession.
But the crowd were anxious for a second goal and Derbyshire was replaced by Jason Roberts in the 64th minute.
The Hammers suddenly hit back with Matthew Etherington seeing his goal-bound chip cleared by Stephen Warnock a minute later.
Then Zamora rattled in a shot from an acute angle that Friedel did well to turn around the post.
Tevez equalised from the penalty spot in the 71st minute after being brought down by Brett Emerton.
The Blackburn defender was incensed and there was a brief melee before the Argentinian took a cool spot kick.
Then Zamora made his mark and Blackburn were reduced to 10 men in stoppage time with David Bentley dismissed after picking up his second yellow card for hand ball.
Teams:
Blackburn Friedel, Emerton, Samba, Khizanishvili, Warnock,Bentley, Kerimoglu (Peter 79), Dunn, Pedersen, McCarthy,Derbyshire (Roberts 65).
Subs Not Used: Henchoz, Gallagher, Brown.
Sent Off: Bentley (90).
Booked: Bentley, Emerton, Roberts, Dunn.
Goals: Samba 47.
West Ham Green, Neill, Collins, Ferdinand, McCartney, Bowyer,Reo-Coker, Noble (Mullins 46), Etherington,Harewood (Zamora 56), Tevez (Boa Morte 84).
Subs Not Used: Spector, Walker.
Booked: Bowyer, Reo-Coker, Zamora, Ferdinand.
Goals: Tevez 71 pen, Zamora 75.
Att: 18,591
Ref: H Webb (S Yorkshire).