Damian Welch's try in the 80th minute secured the Blue & Blacks a vital bonus point victory at the Memorial Ground yet for a long time the winning result was far from a certainty.
The Wanderers, spurred on by dynamic contributions from Ross Johnston and Sam Warburton, led 10-nil at the end of the first quarter at which point Cardiff were in urgent need of a wake-up call. The hosts had dominated territory and possession and on the rare occasions when the Blue & Blacks got their hands on the ball they were unceremoniously harried off it.
Typically, it was Warburton who caused panic at the breakdown in the ninth minute and kicked and chased 60 metres upfield before wing Robin Lock claimed the try. Scott Sneddon converted and then added a 35-metre penalty.
At this stage, Cardiff's hopes were based on the opportunism of their backs and they materialised in the 24th minute when a sudden burst out of defence by Gareth Chapman caught the Wanderers napping. The ball was taken on before the tireless Matthew Veater crossed for an unconverted try. Eight minutes later a quickly taken free kick again brought its reward when the ball was swiftly recycled and Gareth Davies dummied and darted for a try at the posts that he easily converted for a 12-10 lead. But Sneddon's excellent 45-metre goal on the brink of the interval re-established a narrow but deserved one-point lead at the break.
The Blue & Blacks looked more like the table toppers they are in the second half. They regained the advantage with a Davies penalty goal after another attack featuring their speedy back line. But the much needed third and fourth tries eluded them until the closing stages. Ryan Howells, usually so reliable, spilled two scoring passes but Chris Czekaj was causing havoc whenever he ran at the opposition.
In the 65th minute the international wing burst through midfield from a lineout on the left and replacement Rhys Williams gratefully accepted his pass for the try to which Davies added the extras. Cardiff seemed in no hurry to claim the much needed fourth try when Davies, having already missed from 30-metre range, bizzarely elected to go for goal from 50 metres with only eight minutes left on the clock. To no one's great surpriese, the kick fell well short.
When two further attacks were held up just short of the line with Cardiff penalised on both occasions, everything seemed to be petering out. Then one final period of intense pressure ended with Welch barging over on the short side of a ruck and Davies converted.
The winning run was, in the end, finally and deservedly extended to a far from unlucky 13 matches and now the Blue & Blacks are eight points clear at the top of the Premiership with four games left to play.