Wing Aled Summerhill had given the visitors a dream eighth minute lead with a well-worked try before the hosts hit back with tries of their own from Marmion, Fox-Matamua and Poolman.
Cardiff Blues responded with another try from Josh Turnbull – his fourth of the season - and with an extra man in the closing stages of the first half a penalty from Rhys Patchell cut the lead back to just two points.
A third away try – this time from full back Dan Fish - nine minutes into the second half put Cardiff Blues back ahead in a real end-to-end encounter.
But Connacht again wrestled back control with tries from O’Halloran and Muldowney just after the hour mark.
Two missed penalties kept Cardiff Blues out of bonus point range while Carty slotted his own kick just a minute from time.
However, a thrilling finale saw Danny Wilson’s men attack from deep and Hobbs was the last action hero once more as he crashed over in the fourth minute of injury time and Gareth Davies added the extras to ensure Blues left with two points.
Cardiff Blues wasted no time as they worked their way up the field giving winger, Aled Summerhill the chance to dive over the line with Rhys Patchell’s accurate kick securing the extra points for the visitors.
But it wasn’t long before the home side drew level, as Kieran Marmion gathered the ball at the base of the scrum and crossed over. Connacht’s Jack Carty made up for an earlier missed penalty attempt with a successful conversion.
Cardiff Blues looked to grab the lead once more when they created a three-on-one inside the Connacht 22 but a strong tackle from Matt Healy saw the score remain 7-7.
After a good number of phases of pressure from Connacht, Nepia Fox-Matamua scored another try for the home side from the back of a maul. The conversion from Carty extended the lead to 14-7.
Fox-Matamua’s try was followed shortly by a pass from Rory Parata who found Danie Poolman and the winger placed down for a third try for Connacht.
Cardiff Blues won a penalty at the scrum and looked to narrow the gap but Patchell sent a penalty wide of the posts.
However, the visitors didn’t have to wait long to close the gap when Josh Turnbull crossed the whitewash and Patchell converted the try moving Cardiff Blues to within five points.
And with seconds to half time Connacht were reduced to 14 men as O’Halloran was yellow carded for being offside. Patchell kicked the resulting penalty and Cardiff Blues were behind by only two points.
Cardiff Blues continued in the second half just as they had ended the first, making the most of Connacht being down a man.
The visitors were held up on the line but it wasn’t long before they got a deserved third try, as Dan Fish collected a clever chip through to score. Patchell’s conversion saw his side take the lead 24-19.
A scrappy period followed before, when O'Halloran returned to the field, the winger collected a cross-field kick to touch down in the corner. The try was successfully converted by Carty.
Connacht continued to build pressure and after several phases Aly Muldowney charged over for a converted try.
With the clock winding down, Cardiff Blues were awarded a penalty Gareth Davies saw his kick fly wide.
And with only a minute remaining, Cardiff Blues were penalised at the breakdown and Connacht went for the posts with Carty's penalty securing the win.
But, in one final twist, in the dying seconds Cardiff Blues worked the phases and found themselves holding strong in the home side’s 22 before Sam Hobbs crossed over to get the visitors a fourth try and bonus.
Replacement Davies converted the try give Cardiff Blues the added bonus-point for being within seven points.
08m Summerhill t Patchell c 0-7
11m Marmion t Carty c 7-7
24m Fox-Matamua t Carty c 14-7
28m Poolman t 19-7
34m Turrnbull t Patchell c 19-14
40m Patchell p 19-17
49m Fish t Patchell c 19-24
58m O’Halloran t Carty c 26-24
62m Muldowney t Carty c 33-24
79m Carty p 36-24
80m Hobbs t G Davies c 36-31
Cardiff Blues: 15 Dan Fish (G Davies 60), 14 Aled Summerhill (G Smith 19), 13 Tom Isaacs, 12 Gavin Evans, 11 Richard Smith, 10 Rhys Patchell, 9 Tavis Knoyle (L Jones 73); 1 Sam Hobbs, 2 Kristian Dacey (Rees 72), 3 Craig Mitchell, 4 Jarrad Hoeata (Down 64), 5 Lou Reed, 6 Josh Navidi (c), 7 Ellis Jenkins (Vosawai 74), 8 Josh Turnbull
Replacements: 16 Matthew Rees, 17 Thomas Davies, 18 Dillon Lewis, 19 James Down, 20 Manoa Vosawai, 21 Lewis Jones, 22 Gareth Davies, 23 Garyn Smith