Bill Mata and Tom Brown - twice - scored first-half tries for the hosts but Scarlets struck through Morgan Williams and Paul Asquith to trail by just three points at the break.
Johnny McNicholl briefly gave them the lead after Simon Hickey was sin-binned.
But Pierre Schoeman burrowed over for Edinburgh's fourth try, and Mata's clever late second sealed the victory.
Both teams were heavily depleted by injuries and international call-ups, with Edinburgh shorn of 22 players.
With so many out, the onus was on those left behind to deliver. Ally Miller, a 22-year-old debutant on the open-side flank, 20 and 21-year-old locks Jamie Hodgson and Callum Hunter-Hill all stepped up.
And fortunately for Richard Cockerill, he could still call upon Mata, his colossus and the focal point for so much of Edinburgh's play. The monstrous Fijian added another 24 carries - and 84m - to his remarkable league-best haul of 100.
The behemoth got Edinburgh going in the eighth minute when he rumbled and spun over from a line-out drive, Hickey converting.
With Scarlets' first attack, they drew level. Kieron Fonotia swerved past Hickey and a smart off-load released Williams, who beat Brown to score. Dan Jones slotted the conversion.
In between the tries, Scotland call-up Blade Thomson was carried from the field after his head struck the knee of Edinburgh lock Callum Hunter-Hill. It looked like the big New Zealander had been knocked out. A blow for Scarlets and for Gregor Townsend, the Scotland head coach. AGENCIES