Dan Biggar’s three penalties edged the visitors into 9-6 lead at Parc y Scarlets.
And tries from Ryan Jones and Hanno Dirksen sealed the win to rip up the form book.
George North hit-back with a touchdown at the death, which Rhys Priestland converted to secure a losing bonus-point.
The Ospreys went into the encounter on the back of three consecutive defeats while their cross-Loughor rivals were unbeaten.
Priestland opened the scoring in the fiercely contested showdown before Biggar hit-back.
A scintillating break from Scott Williams almost led to the game’s first try but Andrew Fenby lost the ball in contact following a heavy tackle from Kahn Fotuali’i.
The fly-halves continued to exchange shots at goal but it was Biggar who edged the contest to put the Ospreys into a 9-6 lead at the interval.
Dirksen was denied a try in the corner after Richard Fussell’s pass was adjudged to be forward.
Priestland levelled the scores on 48 minutes but was unable to boot the Scarlets into the lead.
Moments later the hosts were dealt a blow when Samson Lee was sent to the sin-bin for persistent infringements at the scrum.
The Scarlets survived unscathed but were punished for their failure to turn pressure into points when Ryan Jones squeezed into the corner on 72 minutes.
Biggar converted from the touchline and just two minutes later Hanno Dirksen repeated the feat with the fly-half again on target.
The quick-fire tries sealed the win but the Scarlets continued to fight and they got their reward when North scored at the death to claim a bonus-point.
Â