Widnes full-back Rhys Hanbury scored two of the Vikings' five tries as the seven-times Challenge Cup winners reached the last eight.
Danny Galea and Kevin Brown crossed too, as Widnes dominated for an hour at the AJ Bell Stadium.
The visitors came close to letting victory slip from their grasp in a thrilling finish as Salford scored twice in as many minutes.
But Lloyd White's last-minute try saw Widnes through to the quarter-finals.
Danny Tickle landed his four conversions, while Jack Owens kicked White's last-ditch match-sealing try.
Gareth Hock (2), Junior Sau and Lama Tasi got the Salford tries, Tommy Lee landing the last two kicks at goal.
Danny Craven made the most of his last-minute call-up, the young half-back, drafted in by Vikings coach Denis Betts when Grant Gore was injured in the warm-up, going on to play a key role.
His first contribution was to combine with his skipper Kevin Brown to get Danny Galea over, and Brown squeezed over soon after.
England back-rower Hock took in Logan Tomkins' pass to charge over and put the Red Devils on the scoreboard, but Hanbury crashed in after Craven booted a 40-20 to create the field position for Widnes.
Danny Tickle landed a third conversion, and the Vikings back-rower slotted again when Hanbury scored his second try.
Sau and Tasi tries gave Salford some hope and when Hock romped in from Greg Eden's break, Iestyn Harris's side were just four points behind.
However Widnes broke through White after Meli had previously failed to force his way in and made sure of their quarter final spot with a fifth try in the final seconds.
Salford head coach Iestyn Harris:
"I thought we got exactly what we deserved if I'm honest.
"Rugby league is about attitude and I'd say, certainly in the first half, they wanted it more than us.
"It's difficult to take and it's concerning. We'll look at the reasons and fix it up. We're leaning day on day here at the moment."
Widnes coach Denis Betts:
"I know the scoreline says it was close but I don't think it was. We were the best team by a million miles but we made a couple of errors and they came back.
"They've a lot of quality in their side but I thought we dominated the game from start to finish.
"We had to shuffle the team around. Danny Craven has not really trained that much but he was fitter than Grant Gore was after the warm-up."
Salford Red Devils: Eden; Platt, Gleeson, Sa'u, Meli; Chase, Fages; Morley, Tomkins, Tasi, Hansen, Hock, Lee.
Replacements: Smith, Griffin, Rapira, Puletua.
Widnes: Hanbury; Owens, Phelps, Dean, Flynn; Brown, Gore; Gerrard, Clarke, Johnson, Galea, Tickle, Leuluai.
Replacements: White, Isa, Clough, Kavanagh.
Referee: Phil Bentham (RFL).