Captain Jack Carty put a penalty miss behind him to send Diarmuid Kilgallen over for the decisive 73rd-minute try, as the westerners completed a hat-trick of early season BKT United Rugby Championship home wins.
Carty’s opposite number Jake Flannery was emerging as the hero of the hour, tagging two penalties onto his snappily-taken 33rd-minute try as Ulster led 13-3 at half-time.
His half-back partner Dave Shanahan scored to make it 20-3, but centres Cathal Forde and Tom Farrell both crossed during a crucial five-minute spell for Pete Wilkins’ men.
Injury-hit Ulster came under further pressure and despite Carty missing a chance to go level, he soon picked out winger Kilgallen to complete a memorable comeback.
There was early disruption for both sides as a nasty clash of heads meant Shamus Hurley-Langton and Ulster debutant Reuben Crothers had to be replaced.
Connacht’s veteran full-back Tiernan O’Halloran beat three defenders on a brilliant break that deserved a try, but the supporting Jarrad Butler was hauled down short.
Carty and Flannery traded penalties just past the 20-minute mark, and while Caolin Blade fizzed around the fringes, the Ulster defence was giving little away.
Indeed, when Harry Sheridan swept through from a ruck on halfway, he reached the Connacht 22 before expertly offloading for Flannery to finish under the posts.
Connacht were stung further when Conor Oliver was penalised for crossing two minutes later, and Flannery took the points on offer.
Shanahan cleverly slipped past O’Halloran to double Ulster’s try tally inside two minutes of the restart. Flannery converted to complete his 15-point haul.
The in-form Forde led the westerners’ response, cutting a clever line to get in behind the posts. Carty’s extras restored the 10-point gap.
Connacht probed off another solid maul before nice hands from Jack Aungier and Carty put Farrell over in the left corner. The skipper also nailed the conversion, leaving it 20-17.
Flannery pushed a kickable penalty wide and Ethan McIlroy then blew an Ulster overlap, putting too much on his pass after doing the hard work to break the defensive line.
The hosts took a grip on the closing stages, staying composed despite Cian Prendergast being held up and Carty’s penalty miss.
Much to the home crowd’s relief, a dinked kick from Carty saw Kilgallen go over untouched in the left corner. Ulster were unable to hit back and had to dig in to avoid conceding a late bonus-point score.