Ospreys had their points from Dan Biggar who kicked two penalties, the second coming on the stroke of half-time after a sustained bout of Welsh pressure.
Munster's try came when they fashioned a break-out from inside their own 22. Johne Murphy injected pace into the move before setting Doug Howlett clear. The Kiwi wing kicked long and deep and when Richard Fussell dawdled with the clearance Barnes was up to block, gather and score.
Biggar moved the visitors within a point at the start of the second half and the Welsh side went ahead for the first time after 56 mins with an intercept try scored by Rhys Webb.
Keatley closed the gap to one point after 62 minutes but a strong defensive effort from Ospreys kept Munster out before Biggar sealed victory with a penalty on the 80th minute to give the table leaders a 17-13 win in Thomond Park.
Video - Niall Ronan gives his reaction after the defeat. View here.