Tries from Garyn Lucas and James Loxton and two conversions and a penalty from Dean Gunter provided the Blues with the early advantage, but the Ospreys struck back to make it 17-9 at the interval, with leading points scorer Matthew Jarvis kicking three penalties.
A try from Richard Randall and nine more points from the boot of Jarvis threatened to spoil the Blues' party, but Dean Gunter won the day and finished the evening with 16 points.
Blues community and coach development manager Richard Hodges said; "The boys played well early on, but did their best to throw it away in a very tight game. However, they stuck in there and gained a valuable win against a very good Ospreys' side."
In the other game, the Dragons made it two wins in as many games when they defeated the Scarlets 20-17 at Narberth.
The Dragons struck first with a 21st minute penalty from Jason Tovey, but the Scarlets bounced straight back and after going through the phases, some slick handling by the home backs saw centre Sam Soul cross for a try that Tom James improved.
Despite plenty of home pressure, it was the Dragons who scored next - a mistake from a Scarlets scrum near their own line allowing Sam Paylor to cross for Tovey to convert.
The only other score of the half was a penalty for the Scarlets by scrum half James, that handed the home region a 17-10 interval advantage.
The Dragons started the second half in determined fashion and from a lineout move 15 metres out hooker Craig Fillier crossed in the corner. Tovey converted, but with both sides having their chances, it was never likely to be the final score.
The Dragons eventually won it when in the last move of the game Tovey converted a penalty