Ulster 27 Ospreys 38:Ospreys bounced back from their Heineken Cup disappointment to consign Ulster to their fourth consecutive Magners League defeat at Ravenhill where Tommy Bowe's last minute try also denied his former side a losing bonus point but gained a valuable one for the visitors.
The win takes the Welsh region up to second place in the table ahead of Friday's clash at Leinster.
For Ulster, the defeat leaves them vulnerable to missing out on next season's Heineken Cup should Connacht overhaul them over the course of the final run of games.
Two tries from James Hook, in either half, along with tries from Shane Williams and former Ulster player Bowe saw the Ospreys boost their hopes of making the play-offs.
Dan Biggar was also accurate with the boot and scored 18 of the Ospreys' total in a game in which the lead constantly changed hands before the Welsh side pulled away in the final minutes.
Ulster's scores came in the first half from Simon Danielli and Andrew Trimble but they were unable to punish Ospreys when Ian Gough was binned late in the second half.
Niall O'Connor made up for an opening penalty miss by nailing his first after 10 minutes but three minutes later Ospreys scored their first try through Shane Williams after a Lee Byrne flick pass.
Referee Neil Patterson consulted the TMO and the score was given though Dan Biggar's conversion bounced out off the upright.
Ulster immediately hit back with another O'Connor penalty and then burst through to score, four minutes before the half-hour, as Isaac Boss, Ed O'Donoghue and Rory Best combined to see Danielli charge over the line and run round the behind the posts to narrow the angle for O'Connor, although his kick was adjudged to have missed by the TMO.
The Ospreys needed to hit back and when a Biggar chip over the top was collected by Hook, he handed off Wallace to score. Biggar made no mistake with the extras and now the Ospreys led again 12-11.
However, they were unable to build on their lead and, in first-half injury time, Trimble raced clear down the left wing with O'Connor this time adding the conversion to give Ulster the lead 18-12 at the turnaround.
Biggar then narrowed Ulster's lead with an early second-half penalty and levelled the scores with another successful kick after Ulster strayed offside.
O'Connor was then wide with a fairly straightforward effort and then gifted Hook his second try after his chip was easily charged down in Ulster's 22, allowing Biggar to add the conversion to put the Ospreys 25-18 to the good.
Again, though, Ulster came back with two penalties from O'Connor, the second coming in the 66th minute after Ian Gough was binned for dragging down a driving maul, and Ulster then snatched the lead back 27-25.
But even with 14 men, the Ospreys managed to keep the scoreboard ticking over in their favour and Biggar kicked two more penalties to give his side a 31-27 lead.
Ulster again had a chance to hit back but lost possession on the Ospreys' line just as Gough returned to the action. You sensed it was a turning point and it proved to be with a loose pass from Boss being hacked upfield by Adam Jones, allowing Bowe to touch the ball down as it rolled over the line.