Tiernan O'Halloran's drop-goal on 78 minutes, his first in professional rugby, snatched the win to complete an outstanding comeback for the visitors with Craig Ronaldson adding a last-gasp penalty.
The victory sees Connacht complete a season's double over Cardiff Blues for the first time as a strong finish saw the province come up trumps.
Welsh international Gareth Anscombe opened the scoring for Cardiff after 11 minutes with a long-range penalty after a Connacht infringement at the breakdown.
A second Anscombe penalty nine minutes later made it 6-0 after Connacht were penalised again with the hosts enjoying the lion's share of possession.
It was a real battle at the breakdown with both sides struggling to create much momentum but it was Cardiff that struck for the first try just before the half hour.
Halaholo weaved past a number of Connacht defenders down the right wing before finally being stopped five metres out. The Blues moved the ball left and despite some desperate last-ditch defence, big number 8 Nick Williams managed to cross with the try awarded after a brief consultation with the TMO. Anscombe added the extras and Connacht faced an uphill battle trailing 13-0.
A score before the break was imperative and the visitors provided one just before the interval as an excellent Jack Carty crossfield kick was collected by Niyi Adeolokun in the 22. Hooker Tom McCartney charged through the middle to move Connacht into the red zone with a perfectly lofted Carty pass finding Healy on the left wing to cross for a superb score. Cooney landed the tricky conversion to make it 13-7 at half-time.
Cooney reduced the arrears further with his first three-pointer on 45 minutes when Cardiff pushed too early in the scrum and Connacht were now in the ascendancy.
The next 15 minutes saw Cardiff on the front foot but Anscombe couldn't make it count on the scoreboard with his penalty coming back off the post after a Josh NGavidi break. That move aside, the tenacious Connacht defence didn't allow the hosts an inch with much of the play taking place in the middle of the park.
The momentum swung slightly back in Connacht's favour just after the hour and Cooney's sweetly struck penalty on 63 minutes drew the sides level to set up a grandstand finish.
A moment of magic from O'Halloran very nearly moved Connacht into the lead on 69 minutes at the livewire full-back scorched through a gap on the right wing but his pass to Adeolokun was adjudged to have been dropped forward.
The Connacht substitutes made a brilliant impact and provided the spark for Connacht to move up a gear with Caolin Blade outstanding after his introduction. The visitors dominated the late stages and although Carty saw his drop-goal attempt drift just wide, O'Halloran made no mistake with his effort and Ronaldson's monster penalty in the last play rubberstamped the win.
Connacht host the Newport Gwent Dragons at The Sportsground next Saturday night at 7.35pm.
Connacht: Tiernan O’Halloran; Niyi Adeolokun, Stacey Ili (Tom Farrell, 58), Craig Ronaldson, Matt Healy; Jack Carty, John Cooney (Caolin Blade, 69); Denis Buckley, Tom McCartney (Dave Heffernan, 65), JP Cooney (Finlay Bealham, 46); Quinn Roux, James Cannon (Nepia Fox-Matamua, 61); Sean O’Brien (Naulia Dawai, 77), Jake Heenan, John Muldoon (captain).