Rovers boss Grant McCann rang the changes, with an alteration in shape as well as personnel. And they made a quick start as they went in front after 15 minutes - Luke Molyneux getting to the byline and putting in a dangerous, low centre which skipper Owen Bailey tucked away from close range - his ninth of the campaign.
Bailey then blasted over in search of a second but that miss came back to haunt the visitors when Cardiff levelled. Omari Kellyman fired home from a central position after Isaak Davies burst past Sean Grehan and put in a wicked delivery.
And the hosts turned the game on its head as they went in front when Cian Ashford held off ample Rovers defenders, dashed half the length of the pitch and fired beyond Thimothee Lo-Tutala.
But the visitors summoned a comeback of their own when Cardiff-born Charlie Crew played a wicked through-ball into Brandon Hanlan and he fired home into the bottom-right corner.
Yousef Salech then propelled the hosts back in front. He initially headed a chance over the bar but atoned for that a minute later when he beat Connor O'Riordan to the ball and made it 3-2. A topsy-turvy game then continued as Harry Clifton fired home Rovers' third.
Both sides went in search of a winner and just as it looked as though spoils would be shared Joel Bagan popped up and fired home a winner to kill Rovers' hearts.

5. James Maxwell 5
Tough gig trying to get up and down in a hybrid, left wing-back role. One of many at fault for Ashford's goal as he waltzed down the left and held off ample players before scoring. Firmed up in a four. Photo: Howard Roe/AHPIX LTD

6. Owen Bailey 7
Right place at the right time - as he so often is - to open the scoring. Blasted over just after but this was an all-action, combative showing from Captain Fantastic. Booked. Got assist for Clifton's goal. Photo: Howard Roe/AHPIX LTD

7. Ben Close 6
A calm head when needed with some decent moments defensively. Cautioned. Photo: Howard Roe/AHPIX LTD

8. Luke Molyneux 7
Another assist thanks to wing wizardry. Shone throughout as he tormented City's left-back all afternoon. Photo: Howard Roe/AHPIX LTD

