Nikki Walker is tackled by Leinster centre Gordon D'Arcy at the RDS
Leinster moved second in the Magners League after Jonathan Sexton kicked all their points in Dublin.
An understrength Ospreys side held a deserved 10-9 lead at the break with captain Justin Tipuric scoring the game's only try on 16 minutes.
Ospreys fly-half Dan Biggar had a poor night in front of the posts, missing five of his six penalty attempts.
In contrast Sexton fired over five of his six penalties to leave Leinster six points behind leaders Munster.
The Ospreys were full value for their half-time advantage at a damp and cold RDS.
Biggar opened the scoring with a third minute penalty before Sexton levelled two minutes later.
The Leinster fly-half put the hosts ahead in the 11th minute with another crisply-struck penalty.
Leinster coach Josef Schmidt admits Dan Biggar misses were 'the difference'
It was to be a memorable first game as skipper for Tipuric, who touched down from a kind bounce after a charge down from a clearance sent the ball high towards the Leinster line.
Biggar converted but he managed to hit the underside of the crossbar from 10 metres out with a 29th minute penalty.
Sexton closed the gap to just a point by firing between the posts with the last kick of the half.
Biggar missed out with a penalty attempt on the restart and it proved costly as Sexton fired over a long-range penalty to make it 12-10 to the hosts.
The Ospreys fly-half completed a hat-trick of missed penalties although his effort was dragged just inches wide.
Sexton was off-target for the first time in the game after 55 minutes but he found his range three minutes later as he put five points between the sides.
Johnson proud of defeated Ospreys
It was turning into nightmare night for Biggar as he squandered another two penalties, much to the delight of the Leinster support.
The Ospreys line-out was also failing and Leinster seized control of the game in the final quarter.
A rare Ospreys attack in the dying seconds fizzled out as Leinster easily held on for the four points, with the Welsh side picked up a losing bonus point.
Leinster: Luke Fitzgerald; Shane Horgan, Brian O'Driscoll, Gordon D'Arcy, Fergus McFadden; Jonathan Sexton, Eoin Reddan; Cian Healy, Richardt Strauss, Mike Ross, Leo Cullen (capt), Devin Toner, Dominic Ryan, Shane Jennings, Jamie Heaslip.
Replacements: Isa Nacewa for Sexton (79), Issac Boss for Reddan (66), Heinke van der Merwe for Healy (40), Nathan Hines for Cullen (56), Rhys Ruddock for Heaslip (62).
Not used: Jason Harris-Wright, Clint Newland, Ian Madigan.
Ospreys: Barry Davies; Nikki Walker, Sonny Parker, Ashley Beck, Richard Fussell; Dan Biggar, Rhys Webb; Duncan Jones, Huw Bennett, Craig Mitchell, Ian Gough, Ian Evans, Tom Smith, Justin Tipuric (capt), Ryan Jones.
Replacements: Jamie Nutbrown for Webb (74), Ryan Bevington for D. Jones (51), Mefin Davies for Bennett (62), Cai Griffiths for Mitchell (59), James Goode for Evans (70), Jonathan Thomas for Smith (70).
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.