But it needed three tries in the final quarter to clinch victory for the Swansea-based region.
Alun Wyn Jones, Adam Jones and Tom Smith crossed for the Ospreys with Dan Biggar booting four penalties and three conversions.
Leigh Halfpenny kicked all of the Blues' points from four penalties.
Ian Keatley kicked 20 points to steer
Tries from Luke O'Dea and Peter O'Mahony put Munster in the ascendancy at Musgrave Park - the hosts led 18-6 at the end of a largely forgettable first half.
Two terrific tries from Stuart Hogg in a five-minute spell got Glasgow firing but Keatley's right boot had the biggest say and a Conor Murray try made the game safe for the hosts.
But Hogg's persistence paid off when he completed his hat-trick in injury-time, with Duncan Weir's conversion securing what could prove to be a vital losing bonus point for the Warriors.
Miah Nikora and captain Gavin Duffy broke through for Connacht tries in a bruising first half, but young centre Paddy Jackson kicked Ulster into a 16-13 interval lead.
Tiernan O'Halloran struck for his fifth try of the league campaign, only for Jackson to dot down in the 53rd minute and keep the visitors on course. However, a Nikora penalty nudged Connacht back in front and they held on to secure a first win over Ulster since December 2005.