The Blues were on course for a first win at the Liberty Stadium, as Gavin Henson returned to his old stomping ground, when Dan Parks slotted a drop-goal.
But Dan Biggar struck to late penalties to steal the victory, following a try from Tommy Bowe.
The hosts dominated the opening exchanges and Wales under-20’s star Matthew Morgan booted the hosts into an early 6-0 lead.
They continued to put the Blues under pressure and came agonisingly close to grabbing the game’s opening try after Morgan released Tommy Bowe. But new Wales cap Alex Cuthbert came to the rescue for the Blues and made a try-saving, last-ditch tackle.
Henson, making his second start since joining the Blues in October, was assured at fullback and launched several counter-attacks.
The capital city outfit almost got on the scoreboard when former Aberavon hooker Marc Breeze intercepted Bowe’s pass but the Ireland international chased back to avert the danger.
But the Blues did get the scoreboard ticking on 20 minutes thanks to a booming Leigh Halfpenny penalty and he levelled the scores with a second shot at goal on 26 minutes to enter the interval tied.
But the Ospreys came flying out of the blocks in the second half and got their reward when Bowe crashed over following a fine break from Ashley Beck.
Morgan missed the conversion and he was punished for his inaccuracy with the boot when Halfpenny slotted his third penalty.
The Blues continued their resurgence and Dan Parks landed a trademark drop goal as they surged into the lead for the first time.
But their lead was short-lived as super sub Biggar hit-back with two penalties to secure the win.
Â