Patrick Ah Van touched down after only three minutes to put the visitors in the lead, but the scores were level soon after thanks to Josh Jones's try.
Paul Wellens then touched down to put the Saints in front, only for Rhys Hanbury to bring his side back on terms in the 22nd minute.
The match swung in St Helens' favour again seven minutes later courtesy of Chris Flannery's try.
The away side then stretched their advantage in emphatic style with tries from Lance Hohaia and Louie McCarthy-Scarsbrook.
Jonny Lomax was on form with the boot as the Saints went in 28-10 to the good at half time.
Lloyd White touched down four minutes after the restart to give Widnes hope, but further tries from Jones and Wellens looked to have put St Helens in a dominant position.
However, the hosts began their comeback in the 57th minute through Kurt Haggerty's score.
They then went into overdirve in the final 10 minutes as Hep Cahill, White and Ah Van all touched down.
Despite bringing themselves to within two points of the Saints, the visitors were able to hold on and progress.