As the scoreline suggests, this result could have gone either way but the hosts got the rub of the green in the end as they outscored Edinburgh four tries to three.
Michael Milne led the way with a brace for the hosts while Andrew Smith and Fineen Wycherley also crossed the whitewash.
For Edinburgh, whose discipline let them down badly in the form of four yellow cards, Ewan Ashman, Ben Vellacott and Darcy Graham scored tries while Ben Healy added two conversions.
Munster made an excellent start when Smith crossed for the opening try as early as the first minute. This, after the Irish province caught the visitors napping by taking a quick lineout inside their half and the ball was shifted to Calvin Nash, who hoofed it upfield.
Smith gave chase and when Graham failed to gather the bouncing ball close to his try-line, the Munster flyer pounced to cross for the opening try.
The Scottish capital outfit did not take long to respond as five minutes later Ashman dotted down under a mass of bodies after a lineout drive deep inside Munster territory.
And in the 15th minute, Edinburgh were rewarded with another try when Vellacott sniped around a ruck deep inside Munster territory before crossing for his side's second five-pointer.
Things then went pear-shaped for the visitors when Glen Young and D'arcy Rae were both yellow-carded in quick succession, inside the closing stages of the half.
Thanks to their numerical advantage, Munster were soon rewarded when Milne scored his first try from close range which meant the match was evenly poised with Edinburgh holding a 12-10 lead at half-time.
Despite that late score from Munster, the visitors were fastest out of the blocks in the second half and they extended their lead in style when Graham gathered a teasing cross-field kick from James Lang inside the home side's 22 before outpacing the cover defence on his way over the try-line.
However, Edinburgh were reduced to 14 men for the third time when Freddy Douglas was also yellow carded for a professional foul on defence in the 53rd minute. Five minutes later, Tom Farrell put Dan Kelly in the clear with a deft offload but he was brought to ground deep inside Edinburgh's 22, before the ball was recycled quickly and Milne barged over from close range for his second five-pointer.
That meant Munster were trailing Edinburgh by four points but they received another boost in the 69th minute when Magnus Bradbury was sin-binned for a croc roll on Lee Barron.
It was only a matter of time before Munster would be rewarded and that happened three minutes after Bradbury's departure when Wycherley crossed for what proved to be the match-winning try.