Wigan produced a late scoring burst to stave off the threat of an upset and book their place in the last 16 of the Carnegie Challenge Cup.
Widnes, the only club to twice defeat Super League opposition as a lower-division team, had their sights on a hat-trick of notable scalps when they led 12-10 after an hour of a thrilling fourth-round tie at the Halton Stadium.
But four tries in a devastating nine-minute spell transformed the scoreline and kept the Warriors on course for a return to Wembley, which was almost home from home for the famous club in the late 80s and early 90s.
Australian winger Pat Richards scored 18 points for the second successive week but Wigan's match-winner was Great Britain second rower Gareth Hock, who laid on two tries in three minutes to swing the game his side's way.
Widnes, with six former Wigan players in their line-up, at least had the last say with two converted tries in the last six minutes and could hold their heads high after an outstanding display which would not have been out of place in Super League.
Wigan discards Oliver Wilkes and Jordan James were outstanding and there were also useful contributions from other old boys Bob Beswick, Mark Smith and Dennis Moran.
The Vikings left the field at half-time to a standing ovation after establishing an 8-4 lead which flattered their Super League opponents.
Former Warrington centre Toa Kohe-Love scored the game's first try on eight minutes, taking a speculative inside pass from his winger Damien Blanch, and Widnes created three more clear-cut chances before the break.
Impressive full-back Scott Grix was denied by a last-ditch tackle from Mick Higham, Beswick had a try disallowed by the video referee and Wilkes dropped the ball with the line at his mercy.
Instead of being out of sight, the Vikings had to settle for two Mick Nanyn penalties to edge them in front.
Wigan's only first-half points came from skipper and loose forward Sean O'Loughlin, who took a pass from Challenge Cup debutant Trent Barrett and scythed through the home defence for a 22nd-minute try.
The Warriors went in front for the first time three minutes into the second half when their best player Thomas Leuluai took another Barrett pass to touch down after setting up the position with a clinical break.
The lead then changed hands twice in five minutes as a tight contest suddenly developed into a points spree.
Widnes hopes rose once more on the hour when Moran's inside pass opening up a defensive hole for Grix to charge through for a glorious try but they were dashed by Wigan's late scoring burst.
Hock got a magnificent pass out of the tackle for Richards to touch down and then got centre Darryl Goulding, a late replacement for the injured David Vaeliki, over for his first try of the season.
Barrett and Richards also pounced as Wigan maintained the momentum, with Richards taking his goal tally to five from six attempts, but James and Paul Noone grabbed consolation efforts in the closing stages for the beaten but unbowed National League men.