Priestland held his nerve to convert the decisive penalty four minutes from time.
And a first-half brace of tries by George North before scores from Nick Reynolds and Gareth Davies ensured the west Wales region left Murrayfield with a maximum points haul
Edinburgh struck first through Tim Visser’s on eight minutes but that was cancelled out when North latched onto Morgan Stoddart’s off-load to grab his first try.
Reynolds followed after an impressive break by scrum-half Davies from the tail of a scrum on 21 minutes.
However indiscipline hurt the Welsh region as young Edinburgh fly-half Harry Leonard kicked three penalties in a row to lead 16-14.
But North burst through a series of tackles to score a sensational second before Davies finished a series of powerful drives by the Scarlets pack to lead 26-19 at half-time.
But indiscipline continued to hurt Rob McCusker’s men as Davies was sin binned and Leonard kicked another three penalties as the Scarlets almost threw it away.
But with Edinburgh leading by less than one score, Rob Denton was penalised following a darting break by Gareth Owen and replacement Priestland slotted the winning kick.