Ospreys (10) 19 LEINSTER (10) 17, Liberty Stadium (Att: 10,702)
Scorers: Ospreys: Try: Justin Marshall; Con: Shaun Connor; Pens: Shaun Connor, James Hook 3
Leinster: Tries: Shane Horgan, Felipe Contepomi; Cons: Felipe Contepomi 2; Pen: Felipe Contepomi
Leinster lost their grip on top spot in the Magners League as the defeat to the Ospreys allowed Cardiff Blues, who bagged a bonus point win at the Border Reivers on Friday, to hit the summit.
With only two rounds of matches remaining, the Blues have a two-point lead over second-placed Leinster with Lyn Jones' Ospreys side, who crucially have a game in hand, two points further back in third.
At the Liberty Stadium, Hook's 76th-minute penalty, his third of the night, preserved the Ospreys' unbeaten home record this season and ensured the title race will go right down to the wire.
Tries from Shane Horgan and Felipe Contepomi looked to have done enough to give Michael Cheika's visitors a smash-and-grab win against their dominant Welsh hosts.
But Wales international Hook had the last say when he kept his nerve to help the Ospreys turn around a 17-10 deficit and snatch one of their most important wins of the campaign.
Shaun Connor and Contepomi swapped early penalties before the Ospreys made the most of their dominance when scrum half Justin Marshall raced through under the sticks for a converted score.
But after the Ospreys squandered a host of opportunities Leinster hit them against the run of play when Horgan intercepted Marshall's long pass to race clear and charge under the posts to make it 10-10 at the interval.
Argentinian star Contepomi gave the visitors the lead for the first time moments into the second half when he brilliantly jinked his way over after Rob Kearney, who did well to take hold of a garryowen, and Chris Whitaker had combined, with Contepomi adding the extras.
But the Ospreys sent on Hook and he made an immediate impression with two penalties.
And when Leinster number eight Jamie Heaslip was sin-binned for a ruck offence in the final quarter, Hook and the Ospreys made the most of their numerical advantage to rubber-stamp the win.
OSPREYS: Stefan Terblanche; Nikki Walker, Sonny Parker, Andrew Bishop, Shane Williams; Shaun Connor, Justin Marshall; Paul James (capt), Huw Bennett, Adam Jones, Jonathan Thomas, Alun Wyn Jones, Ryan Jones, Richard Pugh, Filo Tiatia.
Replacements used: James Hook for Connor (52 mins), Duncan Jones for James (54), Richard Hibbard for Bennett, Lee Byrne for Terblanche (both 61), James for A Jones (75). Not used: Mike Powell, Lee Beach, Martin Roberts.
LEINSTER: Girvan Dempsey; Rob Kearney, Gordon D'Arcy, Shane Horgan, Luke Fitzgerald (Kieran Lewis, 65); Felipe Contepomi (capt), Chris Whitaker; Reggie Corrigan, Brian Blaney, Will Green, Trevor Hogan, Malcolm O'Kelly, Stephen Keogh, Keith Gleeson, Jamie Heaslip.
Replacements used: Bernard Jackman for Blaney, Stan Wright for Green (both half-time), Kieran Lewis for Fitzgerald (65), Cameron Jowitt for Corrigan (75). Not used: Owen Finegan, Guy Easterby, Christian Warner.
Referee: Peter Allan (Scotland)