Cormac O'Flynn had levelled matters, 14 points apiece with a 73rd minute penalty having earlier missed with two attempts in the space of two minutes.
With the game finely balanced Leinster's scrum half John Cooney - who had posed a constant threat all night - broke down the blindside to score in the corner and in injury time when Munster turned over ball in a counter attack from their own 22, Leinster pounced again for a converted try.
What could be described as a lively start ended in three yellow cards, two for the visitors, and an opening try from Cooney all in the first seven minutes.
Noel Reid extended Leinster lead with a penalty but their advantage was cut to two when Gareth Quinn McDonogh kicked goals in the 18th and 28th minutes and Munster took a deserved lead with fine try from centre Michael Kelleher just before the break.
However, Leinster out-half Noel Reid,was on the mark in the 53rd and 61st minutes to restore his side's lead and after Munster had drawn level, those late scores consigned them to a second championship defeat.