In what was a repeat of last May's grand final, the Welsh side were outscored by two tries to one and had to rely on Leinster going down to 13 men to get their one such score - a penalty try in the second half - with their other 14 points all coming from the boot of out-half Dan Biggar.
Leinster had tries from two members of their back-three, Andrew Conway and Isa Nacewa, but ran out of time as they tried to turn a losing bonus point into something greater.
Speaking afterwards, Ospreys director of coaching Scott Johnson said: "I've just said in the changing room that I think we've got to be honest.
"The performance and the execution wasn't great. We are happy with the win but we didn't play well.
"It wasn't a great spectacle but it was a great result. With the group of boys I thought the endeavour was great, it was first class, but when you take a new group like that some of them lack a bit of experience.
"A lot of young players have stood up in this period and we've seen them in a different light, but they are not quite sure how to close out games yet.
"I'm really proud of our effort though, and you can work with effort. I think tonight will be great for their development, and for the momentum of the squad, so we'll take the win but there'll be an honesty call as well."
Some encouraging line-breaks by the Ospreys, who were without 21 players due to international commitments and injuries, produced a first penalty goal for Biggar after nine minutes before that was cancelled out by a Nacewa strike.
Leinster made ground into Ospreys territory through half-backs Ian Madigan and Isaac Boss, with lock Ian Evans penalised for not rolling away.
It was a poor period for the home side, who had prop Duncan Jones sin-binned for coming in from the side just after referee David Wilkinson had issued the Ospreys with a warning.
And three minutes later Leinster were over for the only try of the half, started and finished by the 19-year-old Conway who spun away from the covering Barry Davies to finish off in the left corner, after some clever play from Nacewa.
Restored to 15 men, the hosts gradually ate away at Leinster's 10-3 advantage with Biggar putting over penalties on 33 and 36 minutes.
Leinster made a change at prop at half-time, with Mike Ross replacing New Zealander Clint Newland on the tighthead side, but it did not make much difference as they were penalised from the first set piece, with Biggar putting over his fourth penalty to give the Ospreys the lead.
But it was a short-lived advantage as Leinster scored their second try just two minutes later. Richard Fussell mistimed his slide to collect a ball near the home line and Nacewa was on hand to pick and touch down for his fourth try of the league campaign.
The game was held up for 10 minutes while Conway was treated for a whiplash injury which saw him taken from the pitch by stretcher.
And the match took a dramatic twist when Leinster suffered two sin-binnings in the space of three minutes. Both lock Ed O'Donoghue and Madigan saw yellow for ruck offences.
With the two-man advantage, the Ospreys pressed and, after a series of five-metre scrums, were awarded a penalty try which Biggar converted for a 19-15 scoreline.
The Ospreys were on the back foot for most of the remaining 20 minutes, but Nacewa missed a penalty - he had the accuracy but noy the distance - and in the dying minutes, Leinster failed to convert a close-in lineout drive into a score.
Speaking after the game, Leinster head coach Joe Schmidt said: "I felt that we created more of the play and more chances, but with a little bit more positivity we could have had even more of the play.
"I didn't feel as though they'd score and I was pleased that we broke down their defence maybe half a dozen times.
"We're disappointed with the result but really proud of how the young guys played again.
"We have a short five-day turnaround before travelling to Wales again to face the Scarlets and we, like the Ospreys, have won two out of three games in what is a very tough period."
|Ospreys Score Card|
|Leinster Rugby Score Card|