Media playback is not supported on this device
Wire fell behind to Greg Burke's try but responded through Ryan Atkins and Kevin Brown for a 12-6 half-time lead.
Jay Chapelhow's try and a penalty from Patrick Ah Van gave Widnes a two-point lead after the break.
Matty Russell and Chris Hill went over after Brown's second and third tries, with Ah Van crossing for the Vikings.
England stand-off Brown moved to Warrington for an undisclosed fee at the start of the season after three years at Widnes and was booed by visiting fans throughout, but produced an excellent display for last year's losing finalists.
After a stuttering start to their Super League season, Warrington's win was their fifth straight victory at home and their seventh in a row at the Halliwell Jones Stadium against their neighbours.
They last won the Challenge Cup in 2012, and were losing finalists at Wembley last year when they were beaten 12-10 by Hull FC.
Vikings' injury problems meant they had a number of teenagers in their matchday squad, and Lloyd Roby made his debut.
Denis Betts' side have lost six of their last seven games, and have not won at Warrington since August 2013.
Warrington: Ratchford; Russell, Hughes, Atkins, Lineham; Brown, Patton; Hull, Gidley, Sims, Jullien, Westwood, Cooper.
Replacements: Crosby, Philbin, Smith, G King.
Widnes: Hanbury; Roby, Runciman, Walsh, Ah Van; Mellor, Johnstone; Dudson, Heremaia, Buchanan, Cahill, Olbison, Burke.
Replacements: Manuakafoa, O'Carroll, Walker, J Chapelhow.

Leeds, 15th in the Championship table, looked vulnerable at the start of the season, particularly at set-pieces.
But central defender Bartley has formed an impressive partnership with Pontus Jansson in recent weeks.
Bartley, on loan from Swansea, told BBC Radio Leeds: "You'd have to give the credit to Pep. He had a look and then changed our set-up slightly."
The Yorkshire side were beaten in their opening two league matches of the season, losing 3-0 at QPR and then 2-1 at home to Birmingham.
But on-loan Torino defender Jansson, 25, has played a key role in their improvement.
Leeds have kept clean sheets in their last two games and conceded just two goals in their last four matches - and just one in their last four away games.
Bartley, also 25, explained: "We have Pontus as a spare man who isn't picking up anyone and whose job it is to go and attack the ball, which he has done very well.
"It's made us look a lot more solid. We're going out there now thinking we're going to win, not just hoping."

Matthew Williams was found attacking Cerys Yemm, 22, at the Sirhowy Arms Hotel in Argoed on 6 November 2014.
He was Tasered four times by police and arrested but later died.
The Newport hearing was told he had previously made death and violence threats to his ex-girlfriend, probation service staff and a police officer.
PC Jake Silver, who deals with prolific offenders through Gwent Police's Integrated Offender Management section, said Williams' former partner received seven letters from him while he was locked up.
They contained threats of violence to her as well as threats towards a serving Detective Constable and the officer's wife and his children.
In the letters, Williams described sending a car "up in smoke" and described one person as a "dead man walking".
He described intending to serve his entire sentence - to negate the need to be on licence when released - so he could go "under the radar" when he was let out.
PC Silver said he believed Williams was "very capable of carrying out the threats" but said the Crown Prosecution Service decided there was not enough evidence to peruse the matter as Williams' ex girlfriend was not willing to be a witness.
PC Silver agreed there was a "lack of urgency" surrounding the letters because of an assumption Williams would remain in prison due to a pending court case, which later collapsed.
The inquest continues.
Kevin Brown's hat-trick against his former club gave Warrington a derby win against Widnes to progress to the last eight of the Challenge Cup.
[NEXT_CONCEPT]
Kyle Bartley believes assistant boss Pep Clotet deserves credit for Leeds United's improved defending.
[NEXT_CONCEPT]
A man who killed woman at a hostel had sent letters threatening to kill others while in prison, an inquest has heard.