But Ryan Jones and his team-mates rose to the occasion, putting in a doughty performance to deservedly take the spoils and move four points behind leaders Leinster, whom they face in Dublin on Friday.
Ulster again lacked consistency. A try on the cusp of half-time from winger Andrew Trimble nudged them into an 18-12 half-time lead, but they gave away two soft tries in the second period - the first from a charge down and the second from a loose pass - as the Ospreys took full advantage.
The Welsh region scored four tries in all, the first from Shane Williams, a brace from influential centre James Hook and the fourth from former Ulster winger Tommy Bowe whose Magners League try-scoring record now stands at 38 tries.
It was a fourth straight league defeat for Brian McLaughlin's Ulster side and their poor form has them in danger of being overhauled by Connacht for Ireland's final Heineken Cup qualifying spot.
At the other end of the table, the Ospreys are right where they want to be as the leading teams head for home in the race to reach the play-offs.
Speaking after the game, Ospreys head coach Sean Holley said: "That was just what the doctor ordered. I'm really proud of the way the boys bounced back today, they showed huge character and we ran out deserved winners in the end I thought.
"Ulster are a tough team to beat, particularly here at Ravenhill. It's been a tough week, we've had a lot go against us, but we are trying to do great things at the Ospreys and that was one for the fans and the players to enjoy.
"The win has put us right back in there, we are in second place with three games remaining, but there are a lot of ups and downs ahead of this season still.
"We've got a difficult game ahead of us at the league leaders on the weekend, but we'll go down to Dublin buoyed by the way we played today."
Bowe was involved early on in his first appearance at Ravenhill for two years, but the Ulster quickly put a halt to his midfield run and the home side, so eager to get back to winning ways, generally had the better of the opening exchanges.
They enjoyed a good early bout of possession but after Lee Byrne was pinged for playing the ball on the ground, Ulster out-half Niall O'Connor was off target with his penalty kick from the right.
He made amends in the ninth minute, scoring from closer in after a series of Ulster scrums in the visitors' 22.
Five minutes later, the Ospreys hit back with a try in the left corner from winger Williams.
Jerry Collins, profiting from a lovely flicked pass from Sonny Parker, had gone close to scoring on the opposite side just moments earlier, but the Ulster defence was unlocked when full-back Byrne deftly sent Williams crashing over past the despairing tackles of Trimble and Paddy Wallace.
Television match official Marshall Kilgore confirmed the grounding and out-half Dan Biggar's conversion attempt bounced back off a post.
Ulster responded well with O'Connor's second successful penalty putting them back in front. Then, in the 24th minute, the province scored one of the tries of the season.
Byrne failed to find touch during an action-packed spell, scrum half Isaac Boss countered down the right wing and two terrific passes from Ed O'Donoghue and Rory Best sent Scottish winger Simon Danielli thundering through on a hard line to score to the right of the posts.
It was simple but very effective attacking rugby from Ulster, something which has been all too infrequent during their recent bad patch.
O'Connor's conversion attempt was just off target, and Ulster had no time to rest on their laurels. The lead changed again on the half hour mark as Hook got in ahead of Trimble to gather a chip over the top from Biggar, and the talented number 12 handed off Wallace on the way to the try-line.
Biggar added the extras for a 12-11 Ospreys lead. But Ulster showed their potency again, just before the break, with Best adding some directness to a late attack. The ball came to Trimble who outpaced Collins on the left and nipped past Biggar, who was covering Danielli on the outside, to make it over for another well-finished try.
O'Connor's conversion gave McLaughlin's men a six-point lead to take into the second half. Any hope they had of pulling away after the break was quickly put to bed, as Biggar kicked two early penalties - the first coming straight from the kick-off as Dan Tuohy impeded a chasing Williams.
O'Connor missed a kickable chance to replay and the Ulster out-half erred in the 53rd minute when trying to chip ahead from outside his 22. Hook anticipated this, stretching to his right to block down the kick and the ball sat up nicely for him to run in his second converted try.
Ulster kept in the hunt with three quick-fire penalties from O'Connor, the last of which came after Ospreys lock Ian Gough was sin-binned for attempting to pull down a driving maul from the Ulstermen.
It looked like Ulster, leading 27-25, would be able to push on given their extended preparation time for this game and some solid performances from the likes of Best, Stephen Ferris and Robbie Diack.
Nevertheless, more fresh legs from the bench and Biggar's pinpoint place-kicking - he added a brace of penalties - saw the 14-man Ospreys retake the lead at 31-27.
It really was anyone's game at this stage and just as Ulster rumbled towards the visitors' 22 in search of a score, disaster struck in the 79th minute.
Boss made the error, scooping a loose pass to no one in particular and a hack downfield by Adam Jones led to Bowe getting in ahead of his Ireland colleague Best to dot down his seventh try of the current campaign.
Bowe, a proud Ulsterman, was in no mood to celebrate the try but the bonus point could turn out to be an important one as the Ospreys look to secure a home semi-final.
|Ulster Rugby Score Card|
|Ospreys Score Card|