Three penalties from Ruan Pienaar gave the team a six point lead in the first half, but it was a late try from Ryan Bevington that proved decisive as the champions took a well-earned victory in the PRO12.
It was only the second defeat of the season for leaders Ulster, who will have to be content with a losing bonus point.
Both sides fielded under-strength squads in what was to prove a closely contested game.
"We lacked that edge tonight," coach Mark Anscombe reflected.
"We didn't have that purpose about us in the way we looked after the ball, we didn't get our set pieces in order and didn't strike.
"They played well and deserved the win. They came here with attitude and got the result."
Ulster put their first three points on the board when Pienaar kicked a penalty on four minutes, but Matthew Morgan levelled as Ospreys started to dominate possession.
A second great penalty from Pienarr made it 6-3 against the run of play, before Morgan tied once again.
A third from the scrum half gave Ulster a slim lead just before half time.
Ospreys, who had looked the stronger side going into the break, started the second period well and Morgan slotted over from a penalty kick to draw level again on 53 minutes.
Things then got worse for Ulster with Pienaar leaving the field with what looked to be a shoulder injury.
Stuart Olding landed a penalty kick to nudge the home side in front, while Ospreys Morgan Allen was sent to the bin.
But with 10 minutes to go, the Welsh side countered from their own 22 as Jonathan Spratt linked with skipper Kahn Fotuali'I - the scrum half taking out three defenders with his infield pass to Bevington who scored the try.
It was converted by Morgan to open up a lead for the Welsh side.
Ulster pressed for a try in response but fell short as they went down to a disappointing home defeat, with the Ospreys finishing on the front foot.