The Thomond Park victory was soured by a worrying ankle injury for Munster captain Paul O'Connell, but it could be hugely significant in securing a home semi-final for Tony McGahan's men.
They are 12 points clear of the chasing pack at the top of the Magners League and in pole position to earn a home semi-final, with just three rounds remaining.
Shane Horgan crowned his 200th appearance for Leinster with the only try of a furiously competitive first half.
Horgan's 21st-minute score was supplemented by five well-struck penalties from Sexton, giving Leinster a healthy 20-9 half-time lead.
O'Gara had kicked three penalties for the home side, but Munster produced a storming second half display as their tireless forwards took the game to the visitors.
O'Connell, such a crucial presence lately for both province and country, forced a penalty at the breakdown as Leinster looked to build early momentum.
Munster mauled forward off the resulting lineout and O'Gara converted a close-in penalty for a fifth minute lead. Sexton replied two minutes later, punishing Donnacha Ryan for a ruck infringement.
Munster were first to get within try-scoring range, the outstanding David Wallace driving toward the line off a five-metre lineout. A solid scrum from the hosts set up a penalty from which O'Gara restored their lead at 6-3.
Sexton increased his influence by striking two left-sided penalties through the posts, nudging Leinster ahead by the midpoint of the half.
And just moments later, Horgan delighted the travelling support by finishing off a well-worked move in the right corner for his try.
Isaac Boss and Gordon D'Arcy combined off a scrum on halfway and sent Isa Nacewa through a gap, with the full-back's deft kick gobbled up by the onrushing Horgan.
Sexton drew his conversion attempt across the posts and some hard graft from the home forwards teed up O'Gara for a score from distance.
But Munster lost Johne Murphy to the sin-bin for holding on after making a tackle, and Leinster, who carried the bigger threat in broken play, pressed on.
Sexton coolly slotted the resulting penalty from a difficult position on the right and after a timely turnover from Boss and a good kick chase from Jamie Heaslip, the Leinster out-half moved the margin out to 11 points.
But 14-man Munster immediately lifted the tempo at the start of the second half, O'Gara sustaining a facial wound as he chased his own chip. Then, Doug Howlett raised the decibel level with a smart surge down the right.
Paul Warwick, O'Gara's brief replacement, knocked over a penalty and the returning O'Gara added another to increase the pressure on the Heineken Cup quarter-finalists.
The loss of captain O'Connell, who fell awkwardly at a lineout, did not deter Munster and O'Gara whittled the gap down to 20-18, with Mike Ross singled out for a scrum infringement.
Munster had the bit between their teeth and Leinster were falling foul of referee Andrew Small's whistle. Brian O'Driscoll was the second player to see yellow, picked out for a similar breakdown offence to Murphy's.
O'Gara edged his side ahead with another fine strike, from just inside Leinster's half. The red tide was halted by Sexton's 66th-minute penalty after some good work from Nacewa.
Yet all over the pitch, the Munster threats were increasing. Keith Earls probed with a snappy kick chase, and New Zealanders Sam Tuitupou and Howlett went close on a break down the right wing.
At 23-21 down, O'Gara pushed a penalty to the right and wide after a Munster maul was dragged down illegally, but there was no sense of panic from the hosts.
They were making good use of possession and some fresh legs in the pack kept them going forward.
In a frantic finale, Leinster coughed up a penalty five metres from the try-line. It was a difficult position wide out on the left for an effort on goal but O'Gara showed his class once again to deliver the telling blow.
|Munster Rugby Score Card|
|Leinster Rugby Score Card|