Ulster full-back Adam D'Arcy was controversially sin-binned for a deliberate knock forward on 32 minutes.
The Blues took advantage of the extra man, with Sweeney firing over a penalty to make it 10-8 before James went over for Cardiff's second try two minutes from the break.
Gilroy was caught and dispossed close to the Ulster line and Laulala's pass gave James a clear run to the line.
Sweeney was off-target with the conversion as the Blues went in at half-time with a seven-point lead.
Ulster coach Brian McLaughlin brought on Ireland pair Paddy Wallace and Andrew Trimble early in the second half.
Michael Paterson's failure to hold a James pass cost Cardiff a try and the clinical finishing was soon to come from Ulster.
A Humphreys penalty cut the gap and the fly-half's kick set Gilroy on his way to his second try on 58 minutes, the young wing storming past two defenders before going under the post for a converted touchdown.
Two minutes later and a complete turn-a-round in the game, with D'Arcy sprinting clear down the left wing and going over in the corner.
Humphreys missed the conversion and a subsequent penalty but Ulster were now eight points ahead.
Faloon secured the bonus point with nine minutes left when he burst through for a converted try after a excellent pass from Paul Marshall.
Wallace ran clear to the line after a Blues mistake for Ulster's fifth try in the final minute and Humphreys completed the victory with the conversion.
Cardiff Blues: Chris Czekaj; Richard Mustoe, Casey Laulala, Dafydd Hewitt, Tom James; Ceri Sweeney, Tom Slater; Taufa'ao Filise, Rhys Thomas, Scott Andrews, James Down, Paul Tito (capt), Michael Paterson, Ma'ama Molitika, Xavier Rush. Replacements: Gareth Williams , Tom Davies, Sam Hobbs, Bryn Griffiths, Ben White, Dan Fish, Gareth Davies, Gavin Evans.
Ulster: A D'Arcy; C Gilroy, N Spence, I Whitten, S Danielli; I Humphreys, P Marshall; P McAllister, N Brady, BJ Botha; J Muller (capt), D Tuohy; P Wannenburg, C Henry, R Diack. Replacements: A Kyriacou, B Young, J Cronin, T Barker, W Faloon, I Porter, P Wallace, A Trimble.
Bookmark with:
What are these?