The Blues led for the majority of the match at a bitterly cold BT Sport Cardiff Arms Park thanks to the boot of Gareth Anscombe and a Nick Williams try.
But the PRO12 champions battled back through Matt Healy and they edged into the lead at the death thanks to a Tiernan O’Halloran drop-goal and a Craig Ronaldson penalty with the final kick.
Both sides demonstrated their willingness to attack from kick-off and while Connacht had the first opportunity to points on the board it was the Blues that dominated possession.
Where John Cooney failed to bisect the posts, Gareth Anscombe made no mistake on 11 minutes to give his side the lead.
The fly-half, who took on the kicking duties following the late withdrawal of Steve Shingler, was again on target on 19 minutes.
When Connacht had the opportunity to open their account they turned down a shot at goal and went to the corner but they were unable to secure the ball with Macauley Cook soaring above the Irish jumper.
The Blues soaked up the pressure with Rey Lee-Lo making a key turnover before his centre partner Willis Halaholo made a sensational break.
On several occasions it appeared as though there was no way through for the 26-year-old but he dummied and hitch-kicked his way past at least four defenders.
He was eventually dragged down a metre short of scoring an unbelievable try but the damage was done and Connacht were on the back foot.
Three phases later the pressure told and Nick Williams powered over for a try awarded with the assistance of the TMO.
Anscombe added the extras to bring the scores to 13-0 but they were dealt a blow when Connacht hit back with a converted try shortly before the break.
A rampaging charge from hooker Tom McCartney set up the score with Wales’ Capital Region running out of numbers as a long pass put Matt Healy over unopposed.
John Cooney cut the deficit to just three points with a penalty just four minutes into the second half. Anscombe had the chance to respond but his penalty, into a strong wind, clattered off the uprights.
The Blues dominated the next 10 minutes in terms of possession but the game was all around the half-way line with Connacht resolute in defence and tenacious at the breakdown.
Wilson’s side were unable to turn the period of pressure into points and Cooney levelled the scores with a long-range penalty shortly after the hour mark.
Connacht then moved up a gear and hammered at the Blues line but the home side defended heroically.
The Irish province crashed into the Blues with 30 phases and sublime offload out of contact from Jake Heenan looked to have released Healy for a potential match-winner but he lost the ball with the line at his mercy.
Carty attempted a drop-goal in the final minutes but it sailed agonisingly wide however Tiernan O’Halloran made no mistake as he bisected the posts to take the lead with a minute remaining.
And with the final kick Ronaldson struck a long-range penalty to seal the win.