Leo Cullen’s men remain top of the PRO12 table despite coming under fierce pressure from Cardiff who thrived on turnovers, charging out of their own half for all three of their tries.
Dan Leavy and Luke McGrath returned from Ireland duty with a try apiece as Leinster led 14-7 at half-time, the Blues hitting back with a well-worked Tomos Williams effort.
Cardiff continued to capitalise on Leinster errors, a slick counter attack putting scrum half Williams over for a levelling 47th-minute try before a Ross Byrne penalty made it 17-14.
A breakaway score from Cardiff replacement Sion Bennett had Leinster’s two-year unbeaten PRO12 run at the RDS under serious threat, however second row Molony’s five-pointer from a maul proved to be the match winner.
Cian Healy and Noel Reid were both prominent in a strong start from the province, the latter’s grubber kick being gobbled up by Leavy for a try in the right corner. Byrne topped it off with a terrific conversion.
Williams answered back for the visitors in the 12th minute, Rey Lee-Lo initiating a clever break on the left and then taking Blaine Scully’s return pass before sending the supporting number 9 over. Steven Shingler added the extras from close range.
The Blues continued to threaten on the counter, a better pass from Shingler would have set up captain Scully for their second try but Adam Byrne did well to deny him out wide.
Leinster came out of a patchy spell with their scrum getting on top, particularly Healy on the loosehead side, and number 8 Rhys Ruddock impressing as man-of-the-match. After Michael Bent was stopped just short following a 32nd-minute maul, McGrath dived over from the ruck and Ross Byrne turned it into a seven-pointer.
Neither side could profit from lineout opportunities as the interval approached, and it was out-half Byrne who impressed on the resumption with some deft tactical and cross-field kicking.
A foot in touch from Joey Carbery denied Reid a try, but Leinster soon coughed up a soft score when Gareth Anscombe covered an Isa Nacewa kick and sent Kristian Dacey countering up the right wing. The hosts were caught for numbers and the hooker passed inside for Williams to complete his brace, with Shingler converting.
Although Byrne’s penalty restored their lead, Cardiff quietened the home crowd when another Leinster move broke down and the influential Lee-Lo and Scully combined to set replacement Bennett cantering clear from halfway.
Shingler’s conversion made it 21-17 and with both sides facing European quarter-finals next week – Leinster host Wasps and Cardiff are away to Gloucester – this was certainly a full-blooded preamble.
Cullen’s side got back on track when Leavy forced a ruck penalty and from the ensuing five-metre lineout, Molony used a maul to scramble over near the right corner flag. The grounding was confirmed, with Ross Byrne’s missed conversion leaving just a point in it.
Leinster hung on by the minimum margin in the end, Cardiff blowing a couple of gilt-edged chances as Nacewa produced a try-saving tackle on Tom James and then Matthew Morgan threw a forward pass with a glaring overlap to exploit on the right wing.