Tom Johnstone ran in two second-half tries to help Wakefield secure a 26-14 victory over York at LNER Community Stadium.
Trinity came on strong after the interval to secure their fourth victory in six Betfred Super League matches and their third in a row.
Sam Wood gave York the lead in the 15th minute, igniting a flurry of four tries before the interval.
The lead changed hands two more times in the first half, with Ben Jones-Bishop and Caleb Hamlin-Uele exchanging tries before Oliver Pratt ran in the first of his of his two touchdowns.
With Max Jowitt nailing both conversions, Trinity took a 12-10 lead into half-time and then took control.
Johnstone crossed twice in 17 minutes to sandwich a try by Nikau Williams before Pratt put a gloss on the final scoreline with a late finish.
The victory sees Wakefield climb to third in the table and came on the day they announced that NRL star Roger Tuivasa-Sheck would be joining them next season in a two-year deal.
York sit fourth from bottom with just two wins from their six outings and will be disappointed at fading in the latter stages.
Your Site will again show every game of the Super League live this season - including two matches in each round exclusively live, with the remaining five matches each week shown on