Bela punished a goalkeeping mistake by Jayson Leutwiler to score a breakaway goal in the last minute after Sunjic had been sent off less than two minutes after coming off the bench.
Adam Armstrong equalised from the spot in the 61st minute to cancel out Dan Crowley's first goal for Blues four minutes into the game.
But the final result hardly seemed a fair reflection as Rovers dominated the second half, only for former Blues loan striker Gallagher to waste two good chances after Stewart Downing missed another, while goalkeeper Lee Camp allowed a routine punt from Derrick Williams to slip through his fingers.
Blues, who showed seven changes, scored with their first attack with a superb individual goal from Crowley – but awful defending from the visitors.
Crowley collected a short pass from left-back Kristian Pedersen just over halfway and raced upfield before cutting inside and curling a low, bouncing shot into the far corner of the net from just outside the box.
Crowley began to orchestrate things as Birmingham created three chances.
Gardner drilled wide from just outside the box and Alvaro Gimenez glanced straight at Leutwiler.
But Blues had Camp to thank – and some real wastefulness from Rovers – after Amari'i Bell's cross caused chaos in the box.
Armstrong stabbed goalwards only for Camp to get a hand to the ball, and Gallagher's rebound hit Armstrong, who had strayed offside.
Blackburn's difficulties in front of goal continued after the break, at least initially.
Downing fired powerfully over the bar with only Camp to beat after a poor pass from Jake Clarke-Salter.
Then Gallagher twice fired wide when clean through after Downing and a poor pass from Gardner respectively left him through on goal.
That was the last action for Gardner as he was replaced by Sunjic in the 58th minute.
But the replacement was only on the pitch for less than two minutes before he was sent off for bringing down Gallagher.
Armstrong confidently thumped the ball down the middle from the penalty spot for his seventh goal of the season.
Blues were denied twice by Leutwiler. First he parried Pedersen's drive then he leapt to his left to get a vital fingertip to Bela's swerving drive.
But it was Blackburn who finished the game stronger – until the winner.
Joe Rothwell's fierce, rising drive was held by Camp, who then inexplicably allowed a routine effort from substitute Williams to squirm under him and trickle towards the line, before he recovered to tip on to the post.
Bela scored an unlikely winner when what looked like a low cross was palmed into the net by Leutwiler.