The home side controlled the opening quarter, James Murphy, returning from injury, having a settling effect on the home pack. Joe Griffin gave Cardiff the lead with a penalty in the visitors' twenty-two and he was on target two minutes later to double the lead.
Griffin landed his hat-trick in the 26th minute before the Ravens got on the scoreboard, Jamie Murphy landing two penalties of his own before the break.
The second half was punctuated by mistakes and the whistle. Ellis Jenkins, captaining Cardiff for the first time, tackled anything in Blue that came his way. His work at the breakdown was to give Cardiff a further penalty that Griffin slotted and it was Jenkins who started the moment that won the game.
Stealing the ball on the floor it was recycled on half way. From the ruck, the ball ended up in Richard Smith's hands. The sevens specialist shot through a hole rounded the covering flanker and outpaced the defence to score under the posts, Griffin added the extras.
That looked to have sealed the game, but Ravens mounted a comeback. Murphy landed a penalty before a rolling maul shunted Adam Waite over the line. Murphy added the extras to bring the Ravens within a score, but the defence held firm to move Cardiff up the table.