Phil Price and Dan Evans crossed in the first half while Tom Prydie’s penalty 11 minutes from time proved decisive.
But victory was not completed until the fourth minute of additional time amid immense pressure from the Scarlets scrum.
The visitors’ pack came close to snatching a draw in the final moments.
But Scarlets skipper Rob McCusker lost possession as the scrum rumbled forward and Toby Faletau booted clear to spark joyous scenes at Rodney Parade.
The Dragons had suffered six years of misery at the hands of the Scarlets but stunned their visitors with two tries inside the opening 20 minutes.
Former Wales scrum half Richie Rees proved the catalyst. His break led to Prydie’s opening penalty but the Wales wing was denied a try as early as the eighth minute by Rhys Priestland’s tackle.
Faletau and Lewis Evans also went close but when Rees found Francisco Chaparro, the prop managed to release fellow front-row Price with a scoring pass.
Priestland responded with a penalty but the Dragons had their tails up and struck again when Rees delayed his pass to Evans who strolled through for a remarkable 17-3 lead.
That sparked the Scarlets into life with a second penalty before Wales midfield pair Jonathan Davies and Scott Williams combined for a well-taken try on 33 minutes.
That score offered Scarlets a route back and when Priestland kicked a third penalty early in the second half, there was only a point in it.
The Scarlets missed the chance to take the lead when Liam Williams slipped after a scorching break and Priestland fired a penalty narrowly wide.
That was to hurt Simon Easterby’s side and when Prydie slotted a long-range penalty from the touch line, it opened a crucial seven-point lead – one they managed to hold onto until the whistle.