James Coppinger, with his seventh goal of the season, looked to have grabbed a valuable point to boost Rovers’ survival hopes with a 78th-minute equaliser which cancelled out Chris Burke’s 15th-minute opener.
And a draw would have been nothing less than the hosts deserved, having dominated proceedings at the Keepmoat Stadium only to rue a lack of killer instinct in front of goal.
But Koumas, who had only been on the pitch for three minutes, picked the perfect moment to open his account this season with a great 90th-minute free-kick.
And the on-loan Wigan winger, amid an otherwise disappointing campaign, sealed the win with almost the last kick of the game.
Coppinger, Franck Moussa, Simon Gillett and George Friend all went close for relegation-threatened Doncaster, but the win boosted Cardiff’s hopes of a top-two finish.
Tom Heaton passed a fitness test on his groin strain to ensure Dave Jones could name an unchanged XI from the side who beat Derby 4-1 last weekend.
Doncaster’s influential midfielder Brian Stock also shrugged off an ankle problem which meant, like Jones, Rovers boss Sean O’Driscoll was able to keep faith with the same side who lost 1-0 at Bristol City.
And it was the hosts who started firmly on the front foot, Coppinger drilling an effort inches wide before on-loan Leicester midfielder Franck Moussa forced a good reaction save from Heaton.
Cardiff were under the cosh in the opening stages but they opened the scoring with their first attack.
Jay Bothroyd ran at the Rovers defence before back-heeling the ball into the path of Burke and the winger rifled a low shot under the body of goalkeeper Gary Woods, who should have done better.
Injury-hit Rovers were dealt another blow in the 21st minute when defender Joseph Mills was forced off due to injury.
Gillett was presented with a great opportunity to level when clean through but he was denied by Heaton.
Moussa enjoyed another couple of half chances but Doncaster’s lack of cutting edge was proving their downfall, with nothing to show for their eight first-half shots and six corners.
Doncaster started the second half brightly with Cardiff also lively on the counter, although neither keeper was seriously tested in the first 25 minutes of the second half.
As in the first half, the hosts held the upper hand and pushed for an equaliser, with the lively Coppinger a threat.
Woods produced a great save to deny Peter Whittingham at the other end before Heaton was called upon to deny Coppinger.
Moussa headed over before Coppinger finally levelled with a sweet strike from 18 yards.
Friend forced a solid save from Heaton as Doncaster pushed for a winner.
But they were left shaking their heads in disbelief as substitute Koumas fired home a superb free-kick from distance, before adding an even later third following a well-worked move with Craig Bellamy.