Scarlets were indebted to George Earle for the only try of the game, as well as replacement Aled Thomas, who kicked three penalties, denying Ulster a losing bonus point in the 17-9 victory.
It made up for last week's setback when Scarlets drew 16-16 in Zebre and also ended Ulster's four-game winning streak.
Both sides went into the game stripped of a significant amount of internationals.
The Scarlets were without seven players away on international duty meaning that Kirby Myhill started at hooker and prop Samson Lee returned after a two week suspension.
Apart from the opening exchanges when Ulster opened the scoring with a Ruan Pienaar penalty goal on nine minutes Scarlets enjoyed the wealth of possession and territory for the rest of the first half.
But it took the Scarlets time to convert that pressure into points.
At one stage they went through 33 phases in Ulster's 22 but came away with nothing as the visitors' defence held firm.
Nic Reynolds broke through on another attack but although Lee went over the try was ruled out for obstruction.
Scarlets finally got on level terms with a Steven Shingler penalty on 22 minutes.
The home side's dominance finally paid dividends when Earle went over for a try from a line-out drive on 32 minutes.
And just before the break Thomas, on for the injured Shingler, kicked a penalty to give the region an 11-3 interval lead.
But with all the ball the Scarlets had it could have been more than an eight-point advantage.
Pienaar closed the gap with a penalty five minutes into the second half as Ulster enjoyed a bit more possession
But Scarlets' first concerted attack of the half produced a yellow card and a penalty goal.
Replacement David McIlwaine found himself in the bin for slowing ball at a ruck in the Ulster 22 and from the resulting penalty Thomas kicked Scarlets back into an eight point lead at 14-6.
But that was cancelled out when Pienaar landed his third penalty 11 minutes from time following a Scarlets scrum offence.
And Pienaar had the chance to reduce the gap to just two points but uncharacteristically he missed the target with eight minutes remaining, not helped that flanker Roger Wilson received a yellow card following blatant trip on man of the match Sione Timani.
Crucially for the Scarlets, Thomas kicked a third penalty with three minutes remaining to put his side two scores in front.