Only a series of other results going their way can now keep Ulster in with a chance going into the last weekend of games though Brian McLaughlin's men will now have to travel to Thomond Park to replicate their epic European defeat of Munster in their final league clash and even that may not be enough.
The result was also a blow ahead of Ulster's massive Heineken Cup semi-final with Edinburgh next weekend - especially with Chris Henry, Paddy Wallace and Pedrie Wannenburg all departing with injuries - and saw them fall to only their second home reverse in 21 games.
Defeat also marked their final home game of the season and McLaughlin's last stand in Belfast before he steps aside for Kiwi Mark Anscombe
Leinster, pretty much at full strength ahead of their own European semi-final away to Clermont with Brian O'Driscoll, Rob Kearney and Jonathan Sexton in the side, opened the scoring after seven minutes.
After Fergus McFadden's break, the visitors rucked aggressively towards Ulster's line and Eoin Reddan skipped a pass to Sean O'Brien to put Kevin McLaughlin clean through for the score, which Sexton converted.
Ruan Pienaar could then only hit the upright with a 23rd minute penalty but Ulster were able to hit back almost immediately when a combination of Willie Faloon and Paddy Wallace put Johann Muller into space and the skipper made the line for his first try.
The try was awarded by the TMO despite the fact it appeared Muller made a double movement.
Pienaar saw his difficult conversion sail wide to the left and Leinster stayed 7-5 in front until Sexton made it 10-5 just before the half hour when Wannenburg - in his last appearance at Ravenhill - was penalised at a ruck.
Ulster then lost Wallace, who was taken off looking groggy as he joined Henry who had departed earlier with what appeared to be a shin problem.
Pienaar at least managed his first successful kick at goal with a 37th minute penalty but the half ended with Sexton kicking three points from right under Ulster's posts to give the visitors a 13-8 half-time lead.
Things did not improve for Ulster on the injury front as Wannenburg departed early in the second half before Pienaar was again wide, this time with a long range penalty effort on 52 minutes.
The game then lost its shape as both sides made a raft of substitutions but Leinster still scored next with Sexton nailing a snap drop goal after 67 minutes to take his side's lead to 16-8.
With more substitutions following, the game broke up even more and Ulster were unable to score again in a failed bid to get a losing bonus point.
Retiring winger Shane Williams had the final say once again in a match billed as his farewell to the Liberty Stadium as the
ust as he had done on his international swansong, Williams delivered a dazzling last-gasp try as the Swansea-based region claimed a bonus-point win to confirm their place in the end-of-season shoot-out.
Wales' record try-scorer could yet, though, be back in action at the ground if the Ospreys can seal a top-two finish with another victory in their final match out in Aironi next weekend.
After a storming start, the home side made hard work of putting away a gutsy Dragons side, scoring four tries in all - two of which were penalty tries from their much-vaunted scrum following Ryan Jones' 20th-minute score.
And unless they fall flat on their faces against the league's basement boys next weekend, they look set to be back at the Liberty in the semi-finals.
The hosts' other points all came from the boot of fly-half Dan Biggar, with four penalties from Dragons number 10 Lewis Robling all the visitors could muster.
Williams was given a rousing reception by a season's biggest crowd of more than 14,000 at the Liberty and the Ospreys started as if they meant business.
With wing Hanno Dirksen to the fore, they launched an opening onslaught that lasted nearly four minutes until lock Ian Evans knocked on with a try beckoning.
A break by flanker Ryan Jones then saw hooker Richard Hibbard denied in the corner as the Dragons continued to soak up attack after attack.
And, as soon as they managed to emerge from the siege, the visitors were first on the scoreboard with a fine long-range penalty from Robling.
The Ospreys' response was swift with opposite number Biggar on target after more home pressure, but the Dragons, with barely any possession, were back in front minutes later with Robling adding another three points.
Finally, though, the Ospreys got the try all their intent deserved.
Scrum-half Rhys Webb took a quick tap, centre Andrew Bishop cut through only to be brought down inches short, then Ryan Jones sniffed a gap on the blindside to burrow over. Biggar converted brilliantly from the touchline.
It needed a superb try-saving tackle from Aled Brew on Dirksen to deny the Ospreys a second try on the half-hour mark, but the respite was shortlived.
From the ensuring five-yard scrum, the Dragons' eight crumbled time and again, prop Nathan Buck was yellow-carded and the inevitable penalty try followed.
Biggar's simple conversion made it 17-6 and the Ospreys were in firm control just before the break.
Robling reduced the arrears with his third penalty four minutes after the restart, then the home side found themselves down to 14 men with Biggar yellow-carded for a senseless challenge on Brew as he looked to take a quick penalty.
The lead was down to five points on 56 minutes as Robling bisected the uprights again and suddenly the Dragons were sensing an upset.
But their scrum problems continued when replacement prop Dan Way became the third player of the night to be binned, even though Biggar missed with the penalty that followed.
The Ospreys were denied their third try when Hibbard was deemed to have made a double movement in the process of scoring, but with the Dragons scrum buckling again, another penalty try followed a minute from time.
With the clock ticking down there seemed little chance for any further scoring, but the script appeared to be written for Williams. He took a pass 35 metres out and cut inside the tiring cover before racing to the posts to finish with a cartwheel flourish.
Williams even slotted the conversion to end another memorable night for one of Welsh rugby's all-time greats.