Derrick Williams' first goal for Rovers rescued a point at Ewood Park.
In a match in which the home side had the better of the play and chances for long spells, it looked as though Kenneth Zohore's first half strike would give the Bluebirds all three points.
But with the clock ticking over to 90 minutes, sheer determination from the Rovers defender saw him get on the end of a centre from substitute Connor Mahoney to force the ball home.
The draw sees Rovers remain unbeaten under new boss Tony Mowbray with 8 points from 12, but with a little bit of luck it could have been more.
Unchanged for the third game in succession Rovers looked lively in the opening exchanges.
Derrick Williams saw a sighter flash just wide on five minutes before a Danny Guthrie centre would have picked out Liam Feeney lurking at the back post was it not for Joe Bennett's timely intervention.
Rovers continued to press the Bluebirds back, Craig Conway let fly against his former club, the ball easily claimed, before Williams fed Gallagher but his snap-shot was just wide of the near post.
But the closest the home side would come to opening the scoring came on the 32nd minute when another dead ball from Mulgrew found Gallagher in the box, the young forward struck sweetly on the volley only to see his effort smash off the crossbar and away from danger.
However as the half entered the latter stages it was the visitors who started to impose themselves.
A Peter Whittingham free-kick saw Greg Halford's looping header claimed high by Jason Steele, before they too struck the woodwork when Zohore's hooked effort bounced off the top of the crossbar.
But on 38 minutes a mis-placed pass would prove costly for Rovers as they were caught upfield and Cardiff took full advantage. Zohore advanced before finding former Blues Academy graduate Junior Hoilett on the right. The Canadian sent the ball back into the centre to where the striker arrived right on time to volley the ball home.
Rovers did have the chance to go in at the break all-square with a free-kick in added time. But from a similar position to the one that Gallagher slammed against the bar, Mulgrew's in-swinger didn't threaten.
Boss Tony Mowbray wasted little time in making changes just after the turnaround as first Connor Mahoney, and then Danny Graham, were introduced.
And it was a pass down the right from Mahoney that sent Ryan Nyambe racing into the penalty area. The defender did brilliantly to get the better Joe Bennett to cross to the back post, but Feeney's header was cleared off the line by Jazz Richards.
Sensing a way back into the game Rovers continued to press. Graham was then a whisker wide with a shot from 20-yards, before a goal-saving block from Richards prevented Emnes from teeing up Graham in the six-yard box.
But with Rovers committing bodies forward in the attack, they had to be aware of opportunities for the opposition. A ball into the home box was cleared as far as Sol Bamba, the defender struck well, stinging the gloves of Steele.
Urged on by the home fans Rovers pinned their opponents back for long spells but they could only create half chances.
A Jason Lowe ball into the area saw keeper Allan McGregor flap initially, but he recovered in time to prevent the ball reaching Emnes.
Then with three minutes to go a Mahoney corner was flicked on by Graham but the ball rebounded just the wrong side of the post. Before Emnes then got the better of Richards on the left but as the ball came out to Hope Akpan the substitute steered it wide.
However after knocking on the door repeatedly Rovers finally got their reward bang on 90 minutes.
Quick feet from Mahoney saw him made space for a cross into the box, Williams bust a gut to get on the end of the centre before forcing it home much to the delight of the players and home fans alike.
The point stretches Rovers' unbeaten run to four matches, they now face a tricky away match against Norwich this Saturday.
ROVERS: Steele, Nyambe, Lenihan, Mulgrew, Williams, Feeney, Lowe (c), Guthrie (sub Akpan 66 mins), Conway (sub Mahoney 55 mins), Emnes, Gallagher (sub Graham 57 mins).
Subs not used: Raya (GK), Hoban, Joao, Bennett.
Goals: Williams 90 mins.
CARDIFF: McGregor, Bennett, Morrison (c), Richards, Ralls, Whittingham, Bamba, Halford, K. Harris (sub John 69 mins), Zohore (sub Pilkington 82 mins), Hoilett (sub Noone 75 mins).
Subs not used: Murphy (GK), Meite, M. Harris.
Goals: Zohore 38 mins.
Booked: K. Harris 45+1 mins, Bennett 90+3 mins.
Attendance: 10,645 (including 269 visiting supporters)