Jordan Larmour's 68th-minute try ripped the result out of Munster's grasp as Leinster triumphed in a Guinness Pro14 dogfight at Thomond Park.
Conference B leaders Munster had been the better team up to that point but the defending champions produced a real moment of class to put Larmour over in the right corner.
It was tightly poised at half-time, Tadhg Beirne's try under the posts giving the hosts a 10-6 lead with fly-halves JJ Hanrahan and Johnny Sexton, who appeared in injure his hamstring before being replaced in the 54th minute, landing two kicks each.
The second half was scoreless until replacement Ross Byrne's grubber kick led to Larmour's decisive try. Byrne's conversion was enough to seal a smash-and-grab win.
Leo Cullen says Johnny Sexton was taken off as a precaution. "Somewhere around the hamstring"— Rúaidhrí O'Connor (@RuaidhriOC) January 23, 2021
A number of players, including Beirne, the Guinness player-of-the-match, grasped the opportunity to impress Ireland head coach Andy Farrell ahead of Monday's Six Nations squad announcement.
Chasing their first victory over Leinster since December 2018, an early long-range penalty from Hanrahan set up a very encouraging start for Munster.
Even better followed in the 11th minute, their forwards showed impressive continuity through 13 phases before second-row forward Beirne - supported by a big latch from Peter O'Mahony - burrowed over for a converted score.
A jinking run from the returning Garry Ringrose, coupled with some sharp phase-building, got Leinster firing early in the second quarter and Sexton sent over a straightforward penalty.
With Munster's error count increasing, Sexton and Larmour kicked intelligently to pin them back.
However, the visitors could not convert from two close-in scrums and a lineout, leaving Beirne to pick up a vital turnover penalty.
Right on the edge of his range, Hanrahan hit the post just before the interval and a late Leinster response allowed Sexton to pull back three more points.
Hanrahan had a poor penalty miss early on the resumption before Munster, who were showing more variety in attack, were left to rue a lineout steal by James Ryan.
Mike Haley conceded a five-metre scrum from a clever Larmour kick, but Beirne forced a relieving 55th-minute penalty at the breakdown just as Leinster were poised to strike.
Nonetheless, Leinster's persistence, exemplified by influential scrum-half Luke McGrath, paid off.
From a lineout, Byrne kicked through for Hugo Keenan to link with Larmour and he stepped inside Keith Earls to touch down.
With the rain adding to the difficulty, Byrne added a classy conversion and Munster could not respond to that sucker punch of a try, losing to their fiercest rivals for the fifth time in a row.
Munster: Mike Haley; Keith Earls, Chris Farrell, Damian de Allende, Shane Daly; JJ Hanrahan, Conor Murray; James Cronin, Rhys Marshall, John Ryan, Jean Kleyn, Tadhg Beirne, Gavin Coombes, Peter O'Mahony (capt), CJ Stander.
Replacements: Niall Scannell, Dave Kilcoyne, Stephen Archer, Fineen Wycherley, Jack O’Donoghue, Craig Casey, Ben Healy, Rory Scannell.
Leinster: Hugo Keenan; Jordan Larmour, Garry Ringrose, Robbie Henshaw, Jimmy O’Brien; Johnny Sexton (capt), Luke McGrath; Cian Healy, Seán Cronin, Andrew Porter, Scott Fardy, James Ryan, Rhys Ruddock, Will Connors, Caelan Doris.
Replacements: Ronan Kelleher, Ed Byrne, Tom Clarkson, Ross Molony, Jack Conan, Jamison Gibson-Park, Ross Byrne, Josh van der Flier.