Alan Solomons’ men edged home by a single point to keep their hopes of a top-half finish and return to the elite European Champions Cup alive.
A poor quality first half was marked by a plethora of unforced errors, missed tackles and general untidiness from both sides.
After Blair Kinghorn and Aled Thomas had exchanged penalties it was Edinburgh who struck first when Phil Burleigh danced through the dazzling mandarin-and-custard-clad Scarlets defence to dot down near the posts, Kinghorn converting.
However, the Welsh took control from then on and if it hadn’t been for the accurate boot of Kinghorn, and the wayward one of Thomas – who missed three routine chances – the game could have been gone by half-time.
The visitors were gifted three tries, the first of which came when Cornell du Preez’s wild pass was gleefully accepted by centre Hadleigh Parkes.
James Davies and Steffan Davies then took full advantage of weak Edinburgh defence, with two well-struck penalties by Kinghorn keeping the home side in touch at 23-16 down when the half-time whistle blew.
Kinghorn nudged his side further back into it with another penalty early in the second half and Edinburgh thought they had moved into the lead when Burleigh drove over what appeared to be his second try.
However, the Irish referee Dudley Phillips went to the TMO, who confirmed a double movement.
After the end-to-end breathlessness of the first 40 minutes the game tightened up markedly and became a bit of an arm wrestle.
As the final ten minutes approached, Edinburgh stepped up a gear and, when Burleigh spun wide to sub Magnus Bradbury, the young back-row prospect showed great dynamism to burst through the Scarlets defence and bear down on the line. The momentum continued and it was international lock Ben Toolis who forced his way over to edge his side into a 24-23 lead.
Kinghorn struck the post with the conversion attempt and two minutes later Scarlets had a penalty around 38 metres out but Thomas’ kicking demons returned and he shanked it wide.
The Welshmen continued to press but the Edinburgh line held and there was a huge cheer with five minutes left when great work by Jamie Ritchie produced a pressure-relieving penalty.
But the lineout was lost and the visitors were able to have one last push for victory. They couldn’t break out of their own half and Edinburgh turned over just as the clock struck 80 minutes and the job was done.
“We started off very well. Phil got the try and we were 10-3 up. Then we just basically gifted them 13 points,” said Solomons.
“There was an intercept for Hadleigh off Cornell just chucking the ball away, which was most uncharacteristic of him. Two silly penalties and another silly try from a turnover. The important thing was the resolve the team showed coming back in the second half. And I think our subs made a huge difference, all of them.
“We couldn’t afford to lose this game, it’s as simple as that.
“Our aim is to go game by game. Every one we play from now to the end of the season is critical. We have Connacht next weekend, and they have done really well. They don’t lose too many players to the Six Nations.”
Referee: D Phillips (Ire)
EDINBURGH: Tries: Burleigh, B Toolis, Con: Kinghorn. Pens: Kinghorn 4.
SCARLETS: Tries: Parkes, Davies, Evans, Con: Thomas. Pens: Thomas 2.
EDINBURGH: B Kinghorn; D Hoyland, M Allen, S Beard, T Brown; P Burleigh, S Kennedy; A Dell, N Cochrane, J Andress, A Bresler, B Toolis, J Ritchie, H Watson, C Du Preez. Subs: G Turner, G Shiells, S Berghan, A Toolis, M Bradbury, N Fowles, C Dean, D Fife.
SCARLETS: M Collins; G Owen, RKing, H Parkes, S Evans; A Thomas, A Davies; P John, K Myhill, P Edwards, G Earle, D Bulbring, M Paulino, J Davies, M Allen. Subs: R Elias, D Evans, R Jones, R Pittman, W Boyde, R Williams, D Jones, M Tagicakibau