Trys: Kyle Amor, Richie Mathers, Ali Lauitiiti, Danny Kirmond,
Goals: Paul Sykes 3,
Trys: Rhys Hanbury 2, Paddy Flynn,
Goals: Rhys Hanbury 2, Paul McShane,
Wakefield captain Danny Kirmond was the hero as the in-form Trinity Wildcats secured a sixth successive win to climb into the Stobart Super League play-offs for the first time this season.
The Wildcats trailed for most of the match against a fired-up Widnes Vikings team seeking back-to-back wins for the first time in their efforts to avoid the wooden spoon, but Kirmond ended their resistance with a long-range try five minutes from the end.
The victory lifts the Wildcats above Bradford Bulls into eighth place with one match left of the regular season.
Wakefield, who go to Salford City Reds in their last match next Saturday, probably produced their worst performance of their recent run but it was enough to complete the double over the plucky Vikings, who led 10-6 at the break thanks to two long-range scores from scrum-half Rhys Hanbury.
Wakefield failed to make the most of an early 40-20 kick from Paul Sykes, whose last-minute drop goals earned back-to-back victories over St Helens and Hull KR, and the Vikings seized on his failure to find touch with a penalty.
Hanbury went over for his first try six minutes into the game and scored again a minute from half-time, juggling with the ball from Frank Winterstein's pass and re-gathering his own kick.
In between, prop Kyle Amor touched down for the Wildcats, taking Tim Smith's short pass to dive over in spectacular fashion, and Sykes' goal levelled the scores.
Wakefield lost centre Dean Collis 10 minutes before the break after he was badly hurt making a tackle on Winterstein and the Wildcats lost their way in the match for a time.
They needed a run of three penalties to get them within striking distance of the Widnes line and full-back Richard Mathers took advantage to plunge over for his side's second try on 51 minutes.
The errors continued, however, and the home side put themselves under pressure with a careless forward pass deep inside their own half.
Widnes needed no second invitation and second rower Dave Allen's cut-out pass gave winger Paddy Flynn a clear run to the line.
Replacement hooker Paul McShane restored the Vikings' six-point lead with the touchline conversion but that merely stung Wakefield into action as they produced their best rugby of the match.
Smith got second rower Frankie Mariano charging through a gap in the Widnes defence and the impressive Ali Lauitiiti was on his inside to take the final pass.
Sykes' goal levelled the scores and he put his side in front for the first time on 67 minutes with a penalty awarded for a professional foul by Flynn.
Flynn got back to halt Wakefield substitute Kyle Wood, who supported a break out of defence by winger Peter Fox, but the illegal tackle earned him a spell in the sin bin.
Wakefield's lead lasted only five minutes, with Hanbury tieing the scores for fourth time with a 40-metre penalty, but they went back in front almost immediately with another long-range try.
Wood took Smith's pass to break through the first line of defence and his long pass enabled Kirmond to cross out wide for his side's fourth try.