Wildcats started on minus four points after going into administration in March but this win, their third of the season, lifted them to plus two.
Ben Jeffries scored two tries and Josh Griffin racked up 20 points, scoring his side’s fourth try and kicking seven conversions and a penalty.
Trinity led 26-6 at half-time and Jeffries improved their lead, but three unanswered tries in seven minutes got Quins right back in the game.
However, Chris Dean crossed with Quins short-handed after the sin-binning of Tony Clubb and Jeffries made the game safe, though the visitors battled until the end and scored two late tries.
Wakefield had taken control with early tries by Tommy Lee and Glenn Morrison, and quickly built on that strong start.
Three tries in 10 minutes from Stuart Howarth, Griffin and Luke George gave them a 26-0 lead with just 28 minutes played, and a one-sided rout appeared to be on the cards at that stage.
Harlequins finally upped the pace of their game and Chris Bailey crashed over four minutes later for a try, converted by Luke Gale to give the London side at least some pride to cling to from a dreadful first period.
Jeffries took just three minutes of the second half to make it 32-6 but out of nowhere, Harlequins suddenly stepped up as an attacking force.
Jamie O’Callaghan cut the gap and his team took heart, Rob Purdham and Chris Melling quickly adding to that score to leave Quins just 10 points adrift at 32-22.
But Harlequins suffered a run of penalties for high shots that resulted in Clubb spending time in the bin and Wakefield used the extra man to re-establish their grip on the game.
Chris Dean touched down on 62 minutes and Josh Griffin landed the conversion and a subsequent penalty to make it 40-22.
Jeffries crossed for his second try on 67 minutes but Quins refused to surrender and caused a few late jitters for the home side with tries by Karl Pryce and Luke Dorn in the last 10 minutes.
But Paul Johnson went in for Wakefield’s ninth try two minutes from time, converted by Griffin to wrap up the win and settle the nerves of the Belle Vue crowd.
Wildcats coach John Kear was not entirely happy, but drew on the positives as well as using the result as a ‘thank you’ to the fans for their support in recent weeks.
“I was really pleased with the first half,” said Kear.
“In the four last first-halves we’ve played ourselves into winning positions but not always carried it forward.
“Against Harlequins, though, the players showed some real resolve.
“After half-time we conceded five penalties and you could see the nerves jangling with fans, players and coaches but they stuck to their guns, came through that and we’ll accept 26 apiece (the second-half score) – it was a good game of tig and pass in the second half.
“It’s tough playing in conditions like this but it suited them. They played some good, entertaining rugby league and the people who turned up will have seen effort and application.
“And they’ve also come away with the right result on the scoreboard.
“So it’s a thank you to the fans as well as the lads getting what they deserve at long last.”
Harlequins coach Rob Powell said: “It’s not really the sort of game I want to be involved in and not the sort of game we’ve been talking about wanting to be in.
“How many points do you need to win a game? It would have been 54 today.”
Wakefield Trinity Wildcats: Blaymire, Penny, Dean, George, Griffin, Jeffries, Lee, Amor, Rinaldi, P. Johnson, Mariano, Morrison, Howarth. Substitutes: McCarthy, Wildie, Higgins, Gledhill.
Harlequins: Dorn, Melling, Howell, Pryce, O’Callaghan, Gale, Randall, Wilkes, Ellis, Temata, Purdham, Clubb, Bailey. Substitutes: Williams, Ambler, Koupartisas, Bolger.
Referee: T Roby (RFL).