Scarlets, who had tallied 10 tries in their previous two RaboDirect PRO12 outings, were held scoreless in a first half that ended 8-0 in Connacht's favour.
Miah Nikora, excelling at fly-half with the injured Dan Parks watching on, put the hosts ahead with a penalty and then set up Eoin Griffin for a 39th-minute try to leave Connacht in charge.
But the Scarlets rediscovered their scoring touch immediately after the break as Williams, who turns 19 next Thursday, and George North cut through for three tries in a superb 11-minute spell.
Nikora's second penalty reduced the margin to 17-11, but the Scarlets garnered a late bonus point when stand-in captain Jonathan Davies ran in an intercept score.
Rhys Priestland flung an early penalty wide at the Sportsground, the Welsh region benefiting from the wind advantage and a couple of charges from Samson Lee and North.
Connacht grew into the game with Ethienne Reynecke and Andrew Browne standing out in the forwards, and Nikora punished a scrum offence by Lee with a 10th-minute penalty.
A Willie Faloon-inspired surge almost led to a first try for the hosts, however captain Gavin Duffy spilt Tiernan O'Halloran's pass close to the right corner.
The Scarlets were making little headway until a lineout poach by Richard Kelly set their young backs in motion - North was put into space on the right before Nick Reynolds threatened on the opposite wing.
Handling errors prevented both sides from building momentum and too often the Scarlets fell foul of referee Neil Paterson at the breakdown, most frustratingly after an opportunist break from Josh Turnbull.
Starved of territory, Connacht played a smart game in defence and a series of deft passes unleashed centre Griffin for a near miss on the left.
But the former Ireland Under-20 international managed to score in the opposite corner just moments later, a low slung pass from Nikora taking three Scarlets players out of the game and putting Griffin over out wide.
Nikora was unable to add the difficult conversion and the interval came at just the right time for the Scarlets, who dominated on the resumption.
Just 45 seconds after the restart North burst through to create an overlap and pass for full-back Williams to slip over for his first try which Priestland converted.
Priestland missed a penalty but the visitors had found their groove in attack, with North brushing past Duffy's attempted tackle on the right to raid in for his five-pointer.
Another missed tackle cost Connacht dearly as Williams evaded Griffin's grasp to score again to the left of the posts, extending the lead to 17-8.
Connacht responded with a penalty from Nikora on the hour mark, and they pushed hard for a match winner until Davies intercepted Nikora's high pass in the last minute for a long range gallop to the line.
Jonny Sexton landed a drop-goal with the last kick of the game to help Leinster move into the top half of the table with a 19-18 win at Treviso.
On a night when Leinster welcomed their international contingent into the squad, it looked as though Treviso were going to record an impressive win when Fabio Semenzato crossed with a minute remaining.
But Sexton proved his class and split the posts with no time left.
It was tough on Treviso who looked good throughout and actually led 8-3 at the half-time interval.
Alberto Di Bernardo got them going with an early penalty and, when Kevin McLaughlin was sent to the sin bin, Treviso cashed in, with Robert Barbieri going in from close range.
Sexton ensured Leinster were on the board at half-time, kicking a penalty, and after the break Brian O'Driscoll opened their try account when he went on an angled run that ended under the posts.
Sexton converted and then added a penalty, before Kris Burton reduced the gap to two points with a three-pointer.
It was immediately cancelled out by Sexton's next shot at goal, but when Semenzato's try was converted by Burton it looked as though Treviso had won the day.
Sexton had other ideas, though, and duly had the final say.
Fly-half Rhys Patchell kicked 11 points as Cardiff Blues downed Newport Gwent Dragons 16-5 at Rodney Parade.
A Steffan Jones try helped give Newport a 5-3 half-time lead but Cardiff hit back after the break to take the victory thanks to a try from Alex Cuthbert and the boot of Patchell.
It took 37 minutes for the first points to be scored but, after a slow start, the derby burst into life with plenty of blood and thunder by both sides.
Wales coach Warren Gatland watched in the crowd as he assessed his probable and possible players for the Tests in November.
And there was no quarter given by Welsh team-mates, going at each other with vigour, and fully illustrated when Wales captain Sam Warburton was put down by his national back-row colleague Dan Lydiate with a thump in the first half.
Home wing Tom Prydie was the first to try and break the deadlock as the match warmed up but his mid-range shot at goal went wide.
The Blues could have scored when a great break from Patchell saw him find centre Dafydd Hewitt who, in turn, passed inside for co-centre Gavin Evans to have a clear run to the line but the move was halted for a forward pass.
However, it signalled far more enterprise from the teams and, after Jones saw a massive 53-metre kick hit a Blues post and then the crossbar on its way down, Cuthbert made a superb break through the floundering home midfield.
The Wales ace looked on course to cross as he stormed upfield but was hauled down by Prydie.
Eventually, Patchell did open the scoring with a 42-metre penalty but any hopes the visitors had of going into the break in front were ruined as a surge upfield saw home prop Phil Price feed Jones to beat Blues scrum-half Lloyd Williams to the line for his unconverted touchdown.
And the Blues found themselves struggling again early into the second half.
A charge downfield from Price saw the Blues defend desperately at a ruck before the home loose-head picked up and drove to the line. The Third Match Official had a long look but did not give the try.
The Blues then lost prop Nathan Trevett to the sin-bin for not rolling away from that attacking ruck.
However, the Cardiff region found their way near the home 22 and were gifted a try when the Dragons fumbled ball for Cuthbert to score near the posts, with Patchell converting.
As the half progressed, there was bucketloads of passion and endeavour from both sides, with the Dragons getting the edge in territory, but no real ideas from either team of how to break strong defences.
The Blues tried bombarding the home side with high balls to the full-back position but few had much of a positive effect.
Prydie and Patchell both missed penalties, but eventually the Blues pulled clear and denied the Dragons a losing bonus point as Patchell landed two penalties within two minutes late on.
- Eoin Griffin