The other points for the Irish came with a first-half try for flanker Niall Ronan. It was Munster's 13th straight win over the Scarlets.
The Scarlets, who had a try for flanker Aaron Shingler, two penalties for Rhys Priestland and one for Stephen Jones, led twice but could not match Munster's more streetwise approach.
It did not help the Scarlets that they suffered a pre-match setback with wing George North ruled out with a dead leg.
The 19-year-old was injured in Wales' defeat to Australia last weekend and the region had hoped he would recover.
But North has failed a late fitness test. It meant Liam Williams moved to the wing from full-back with Dan Newton filling the number 15 jersey.
The Scarlets, spurred on with their first two wins against Castres and Northampton and a record Heineken Cup crowd of 13,183, had much of the better of the opening quarter which was reflected in an 8-0 lead.
Priestland was wayward with an early penalty shot but a vocal home crowd were soon cheering a Scarlets try on six minutes.
A Will Chambers attempted pass went astray with Jonathan Davies hacking on with Shingler following up and going over.
Priestland's conversion struck the post but three minutes later he was on target with a penalty after Munster had erred offside.
But after that Munster gradually came more and more into the game after going close with a try on 15 minutes.
Munster's comeback was started when Priestland was forced to take a ball over his own line. From the resulting scrum Scarlets collapsed and O'Gara broke the Irish province's duck with a 27th-minute penalty.
That spurred Munster into action and their opening try came after Newton failed to find touch from his 22. Munster ran it back down the right touchline with Ronan stepping inside scrum-half Gareth Davies to go over.
Munster's comeback was complete in the final minute of the half when O'Gara's second penalty gave them an 11-8 interval lead.
Priestland got it back to 11-11 10 minutes into the second half and they had the chance of what looked like a certain try but Jonathan Davies failed to find Scott Williams, who was free outside him.
And Munster made the Scarlets pay with two more penalties on 56 and 62 minutes.
But in a match that was always going to be decided by small margins the Scarlets got back to within three points with a penalty from Stephen Jones, who took over the kicking duties from Priestland who missed two penalties and a conversion.
But it was not enough as the Scarlets made key handling mistakes in the dying minutes.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The Barbarians are one of the top invitational rugby sides with a long history and classic rugby jersey.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Lions get ready for their matches with this green training jersey. It's what the players wear. Get in the Gear!
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The Lions are ready to get their Australia tour underway. They arrive in Perth on Monday.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.