Wakefield winger Peter Fox ran in a first-half double as Catalan Dragons went down to a surprise defeat at Belle Vue.
Ben Cockayne and Andy Raleigh also scored before the break as Trinity led 24-6, Danny Kirmond then scoring in the first minute of the second half.
But the Dragons bounced back after the break with tries from Scott Dureau, Vincent Duport and Clint Greenshields.
Gregory Mounis had scored the visitors' one first-half try.
Wakefield stand-off Isaac John closed out the game with a penalty on the final hooter, his sixth kick of the afternoon.
Wakefield ended a five-match losing run with their first home win of the against an out-of-sorts Dragons, winter signing Fox scoring his first tries since the Wildcats' opening-day win at Widnes.
One lapse in defence by Richard Agar's men let the Catalans in for Mounis's try on 34 minutes, but the Wildcats were good value for their half-time lead.
Winger Cockayne opened the scoring after 12 minutes with his seventh try of the season and two in five minutes from Fox and Raleigh midway through the first half put the home team in control.
Fox then closed the half with an 80-metre breakaway try, converted by John, who was on target with all four first-half conversions.
John added to Wakefield's healthy lead with penalty and a try from Kirmond on 52 minutes looked to have locked up the points.
But the men from Perpignan team struck back through Dureau and Duport and Wakefield survived a late scare when a four-man move from 70 metres out put in the fit-again Greenshields for the final try, converted by Dureau.
The game was played in front of a crowd of over 7,000 at Belle Vue, some 3,000 more than watched the corresponding fixture a year ago - and coach Richard Agar is proud of how his club are developing.
FROM THE DRESSING ROOM
Wakefield coach Richard Agar:
"It was a really good crowd, it made for a terrific atmosphere and, as a team and a club, we're really progressing.
"I thought we were really strong at times. But we never felt comfortable, because you can't against a side that is dangerous all over the park.
"It will do us good to know that we can get over the line. We're still learning how to win a game and in a few weeks I'd like to think we'll be closing out games sooner."
Catalans coach Trent Robinson:
"We were pretty poor, we were disappointing. There were quite a lot of errors in our game in the first half.
"Not for the first time we've let the team get away from us then come back in the second half. That's when we get comfortable, when we're coming from behind.
"We need to be comfortable at the start of a game so that we're in a better position to lead at half-time instead of chasing the game."
Wakefield: Mathers; Fox, Collis, Mellars, Cockayne; John, Smith; Amor, Aiton, Raleigh, Lauitiiti, Kirmond, Washbrook.
Replacements: Wood, Southern, Johnson, Wilkes.
Catalan Dragons: Bosc; Greenshields, Baile, Duport, Millard; Pryce, Dureau; Paea, Fisher, Casty, Sa, Raguin, Baitieri.
Replacements: Ferriol, Mounis, Pelissier, Fakir.
Referee: Robert Hicks (Oldham).