Media playback is not supported on this device
A tight first half was scoreless for 30 minutes until Paddy Jackson's two penalties put Ulster 6-3 up at the break.
Rhys Patchell struck his second penalty to bring Blues level but Craig Gilroy's try put the Ulster back in front.
Patchell combined with Ray Lee-Lo for a fine team score, before Aled Sumerhill touched down to seal victory.
Despite a second successive defeat against Welsh opposition - following their home loss to Scarlets - Ulster stay fourth in the Pro12 table.
The visitors seemed in control at the Arms Park when wing Gilroy ran in unopposed to put them 13-6 in front.
But the Blues responded strongly, camping themselves in their opponents' 22 and reducing their deficit with a third Patchell penalty.
The Wales international fly-half then provided the game's defining moment as he exchanged passes with centre Lee-Lo before touching down for an impressive try.
The Blues demonstrated a similar poise to put the game beyond doubt, capitalising on an overlap for Summerhill to score in the corner.
Cardiff Blues: Dan Fish; Blaine Scully, Aled Summerhill, Rey Lee-Lo, Tom James; Rhys Patchell, Tomos Williams; Brad Thyer, Matthew Rees, Salesi Ma'afu, Jarrad Hoeata, James Down, Josh Turnbull, Ellis Jenkins, Manoa Vosawai.
Replacements: Kristian Dacey, Thomas Davies, Taufa'ao Filise, Macauley Cook, Josh Navidi, Lewis Jones, Jarrod Evans, Garyn Smith.
Ulster: Stuart Olding; Craig Gilroy, Luke Marshall, Sam Arnold, Jacob Stockdale; Paddy Jackson (capt), Ruan Pienaar; Callum Black, John Andrews, Bronson Ross; Peter Browne, Franco van der Merwe; Robbie Diack, Chris Henry, Nick Williams.
Replacements: Jonny Murphy, Kyle McCall, Ricky Lutton, Roger Wilson, Sean Reidy, Paul Marshall, Darren Cave, Rory Scholes.
Referee: John Lacey (IRFU)
Assistant referees: Dan Jones, Gwyn Morris (WRU)
Citing commissioner: John Charles (WRU)
TMO: Jon Mason (WRU)
Cardiff Blues scored two late tries to beat Ulster and dent the visitors' Pro12 play-off hopes.