The home side were indebted to tries from Barry Davies and Hanno Dirksen as well as 16 points for outside-half Dan Biggar.
Connacht deserved their losing bonus point with number 10 Niall O'Connor securing it with the last kick of the game after skipper Gavin Duffy had gone over for two tries.
The Ospreys made the more positive start as a Biggar kick to the corner put Connacht under severe pressure.
Connacht secured the subsequent line-out but outside-half O'Connor's clearance kick was caught by skipper Justin Tipuric. The ball was moved impressively along the backline before centre Tom Isaacs put full-back Davies over in the left corner.
Biggar put over the conversion as the Ospreys led 7-0 after six minutes.
Connacht had a chance to get on the scoreboard with their own try but wing Tiernan O'Halloran's wayward pass to Duffy, who was free in the left, went into touch.
The home side enjoyed plenty of possession but it was Connacht who scored next to level after 24 minutes when pressure under the Ospreys' posts led to Duffy being put over in the right corner for a try converted by O'Connor.
But a penalty from a scrum 35 metres out was kicked by Biggar to restore the Ospreys' lead after 30 minutes.
And five minutes later Ospreys were over for their second try. A Biggar free-kick bounced off Tipuric's shoulder right into wing Dirksen's hands and the wing had a free run in by the posts.
Connacht had the final say of the half with O'Connor kicking a penalty as Ospreys led 17-10 at the break.
And there was better news for the Irishmen after the break when by Ian Gough was handed a yellow card for a high tackle.
But despite being down a man it was the Ospreys who scored next with a Biggar penalty from close to halfway as the Ospreys led 20-10 on the hour.
The Ospreys could never relax however and Connacht stunned the home side with their second try when Duffy went over in the left corner after a fine kick ahead from Niall O'Connor.
The Ospreys kept their noses in front and went two scores ahead with Biggar putting over his third penalty.
But that was cancelled out by an O'Connor drop-goal just a minute from normal time, although the kicking duel continued as Biggar kicked a fourth penalty four minutes into injury time.
Though Connacht lost they had the final say with O'Connor's penalty in the 88th minute securing them a losing bonus point.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.