Match ends, Brentford 1, Birmingham City 2.
Goalkeeper Tomasz Kuszczak made a string of fine saves as Birmingham City edged out Brentford at Griffin Park.
Ex-Bees striker Clayton Donaldson put Blues ahead with a penalty after he was fouled by home keeper Daniel Bentley.
Ryan Shotton blocked Lasse Vibe's shot on the line, before Kuszczak denied Vibe, Maxime Colin and Scott Hogan.
Shotton smashed home Donaldson's flick on before Hogan's deft header reduced the arrears, but the striker then had a late effort ruled out for offside.
Brentford are now without a win in four at home, but had plenty of chances to get something from the game.
Colin's shot just after half-time was parried by Kuszczak, who quickly recovered to save from Hogan, and moments later Birmingham doubled their advantage.
But his most impressive save came when Hogan's downward header bounced up and looked destined for the net, only for the former Manchester United goalkeeper to push the ball onto the bar.
Gary Rowett's side stay fourth in the table after back-to-back wins, having picked up a much-needed first away victory in six attempts.
Brentford manager Dean Smith:
"If it was a boxing match it would have been stopped, but football matches in the Championship change on small moments. We were a little loose once or twice and got punished for it.
"It was just one of those games in which we didn't take our chances. It's when you don't create them that you need to worry.
"This is a team that are in the top five and we have dominated them. We passed well and created chances so it's very hard to go into the changing room after that."
Birmingham City boss Gary Rowett:
"We rode our luck. If luck was a horse I'd have won the Grand National today.
"We've defended last-ditch. Part of that was because we were sloppy and didn't get close enough to them at times, but we've scored two good goals and then had to hang on and be gritty and tough.
"We are not an easy side to beat, but we work incredibly hard and we want to keep improving because if we play like we did today we will struggle to stay in fourth."
- 1BentleyBooked at 13mins
- 14EganBooked at 20mins
- 29BarbetSubstituted forMcEachranat 71'minutes
- 19SawyersSubstituted forKaikaiat 62'minutes
- 21VibeSubstituted forClarkeat 71'minutes
- 26DavisBooked at 80mins
- 7TescheSubstituted forAdamsat 64'minutes
- 11CotterillBooked at 48minsSubstituted forBrownat 64'minutes
- 15JutkiewiczSubstituted forRobinsonat 83'minutes
- Andy Madley
- Shots on Target
Second Half ends, Brentford 1, Birmingham City 2.
Foul by Maxime Colin (Brentford).
Jonathan Grounds (Birmingham City) wins a free kick in the defensive half.
Attempt blocked. Che Adams (Birmingham City) left footed shot from the left side of the box is blocked. Assisted by Ryan Shotton.
Attempt saved. Sullay Kaikai (Brentford) right footed shot from outside the box is saved in the bottom left corner. Assisted by Josh McEachran.
Corner, Birmingham City. Conceded by Andreas Bjelland.
Attempt missed. Clayton Donaldson (Birmingham City) left footed shot from the left side of the box is too high.
Harlee Dean (Brentford) wins a free kick in the defensive half.
Foul by Clayton Donaldson (Birmingham City).
Offside, Brentford. Andreas Bjelland tries a through ball, but Scott Hogan is caught offside.
Attempt saved. Josh Clarke (Brentford) right footed shot from the right side of the box is saved in the top centre of the goal. Assisted by Josh McEachran.
Attempt saved. Che Adams (Birmingham City) right footed shot from the centre of the box is saved in the bottom left corner. Assisted by David Davis.
Substitution, Birmingham City. Paul Robinson replaces Lukas Jutkiewicz.
David Davis (Birmingham City) is shown the yellow card for a bad foul.
Josh McEachran (Brentford) wins a free kick in the defensive half.
Foul by David Davis (Birmingham City).
Goal! Brentford 1, Birmingham City 2. Scott Hogan (Brentford) header from the centre of the box to the high centre of the goal. Assisted by Josh Clarke.
Foul by Maxime Colin (Brentford).
Clayton Donaldson (Birmingham City) wins a free kick in the defensive half.