The visitors, who had opened their Anglo-Welsh campaign with a win over Wasps last weekend, led 13-3 during the opening half thanks to a try from flanker Luke Hamilton and eight points from fly-half Gareth Davies.
But the Scarlets hit back through a converted penalty try and a Liam Williams penalty to level.
Davies put the Blues back in front, but Thomas stepped up to give the hosts the victory.
The Blues struggled during the early going and conceded a steady stream of penalties, which Scarlets centre Gareth Owen took advantage of to give the hosts a 3-0 lead, although he was off-target with two further penalty attempts.
But it was the visitors who registered the first try on their first foray into Scarlets' territory.
Fly-half Davies made the break down the short side and found Gavin Evans and Hamilton in support for the flanker to canter over for a converted score.
Davies extended the lead with a penalty, but the Blues then lost prop Sam Hobbs to the sin bin for an awful challenge on Wales full-back Williams.
Hobbs' shoulder charge flattened his opponent, and the Blues loosehead was fortunate the card issued by referee JP Doyle, who was within a couple of yards of the incident, was not red.
Despite the numerical disadvantage, Davies put the Blues 10 points to the good with his second penalty.
But Hobbs' absence did prove costly for the Blues just five minutes before the break.
Their seven-man pack splintered at a scrum five yards from their own line with Campese Ma'afu, just on as a replacement, collapsing to concede a penalty try, which Owen converted from straight in front.
More scrum trouble yielded a penalty for the Scarlets moments later.
Williams was wide from the halfway line, but levelled the scores with a successful attempt right on half-time, only for Davies to respond by putting the Blues back ahead four minutes into the second half.
The Scarlets turned up the heat and wing Andy Fenby had a great chance to hit back for the Scarlets after gathering in Dan Newton's lovely cross-kick, but he was hauled in by the cover defence.
Williams looked to have registered the Scarlets second try as he slid over after the hosts had stretched the Blues defence, but he was denied by the video referee Tony Rowlands, who adjudged he had not grounded the ball.
They did at least level matters with a penalty from Thomas, the Scarlets third goal-kicker of the evening, with 15 minutes remaining.
And further Blues ill-discipline allowed Thomas to add two further penalties, the second of which saw Hamilton binned for a ruck offence, to put the hosts six points clear with 10 minutes remaining and seal the win.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
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 All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
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.