In wet conditions, man-of-the-match Rhys Patchell converted six penalties and a drop goal to decide this scrappy encounter in the home side's favour.
Referee Claudio Blessano had too much of an influence on proceedings for Connacht's liking, the heavy penalty count against the westerners allowing Patchell to kick the Blues into a match-winning position.
Matt Healy's second try of the new league season had launched the province towards a 10-9 half-time lead, with Patchell kicking all of Cardiff's points in response.
But a combination of unforced errors and costly penalties saw Connacht lose their way in the second period as Patchell's reliable right boot kicked the Blues to their first win of the season.
It was not the best of starts for Connacht as former Cardiff favourite Dan Parks kicked the ball out on the full, and he had a 50-metre penalty effort that fell just short of the posts.
But, in a fast-paced opening, Pat Lam's men had a good deal of early possession and Robbie Henshaw - starting at outside centre - was unfortunate to lose control of the ball as he looked to slice through midfield.
Patchell, the scorer of 15 points in Glasgow last week, watched his first penalty attempt of the night come back off the right hand post and Connacht cleared the danger.
With space at a premium on the rain-soaked 4G pitch, both sides probed with grubber kicks and chips before Connacht moved ahead thanks to Healy's 12th-minute try.
After Henshaw was swallowed up on the Cardiff 22, the Blues were caught cold as Kieran Marmion broke smartly from the ruck and passed to his right for Healy to slide in under the posts.
Parks landed the simple conversion and Cardiff continued to look short of confidence as Patchell swung a penalty kick wide to the left of the target.
The young out-half made amends with a three-pointer from just inside the Blues half, and Patchell lifted his side soon after with some clever counter-attacking play.
Tiernan O'Halloran was then pinged for a push on Harry Robinson under a high ball, allowing Patchell to close the gap to a point by the half hour mark.
Connacht fell foul of the Italian official's whistle on successive occasions, robbing them of promising positions in and around the 22, and Patchell picked off a fine drop goal to move the Blues in front.
Returning Lion Alex Cuthbert also grew into the game, enjoying quite a tussle with the in-form Healy on the far wing, while Henshaw continued to pose a threat in the middle.
Connacht retrieved the lead on the stroke of half-time, Parks punishing Lloyd Williams for a crooked scrum feed.
The fit-again Gavin Duffy was heavily involved, along with Healy, as Connacht pressed for their second try on the resumption, the Blues returning the favour as Cuthbert and Wexford man Robin Copeland tried to bulldoze their way through.
Connacht had most of the possession but lacked direction at times, with Cardiff defending well and a George Naoupu infringement - he played on after being tackled - released the pressure on the Blues.
Brett Wilkinson was then singled out for bringing down a scrum, giving Patchell the opportunity to right foot Phil Davies' charges ahead again at 12-10. It was a lead they never lost.
Cardiff got their maul going and Connacht had to scramble to prevent a try out wide on the left, Duffy and O'Halloran doing well in that regard after Cuthbert had popped up in midfield and opened up an overlap.
Parks missed a difficult penalty. drifting a kick to the left and wide, as Lam turned to his bench for the final quarter - bringing on the likes of Jake Heenan, Aly Muldowney, Paul O'Donohoe and Craig Ronaldson.
Another of Connacht's replacements, prop Rodney Ah You, was penalised at a scrum and although Patchell's subsequent kick was off target, he nailed a fifth successful penalty shortly afterwards with Heenan whistled up for going off his feet.
The momentum was now with the Blues and Patchell tagged on two more penalties in the final seven minutes, taking the bonus point away from Connacht who had Ah You sin-binned for a 76th minute binding offence.