Wakefield dominated the first half, with Frankie Moriano coming closest to crossing the line but the visitors' defence held firm.
However, two Keith Lulia tries on the stroke of half time ensured that the away side went into the second half with the momentum.
Wakefield extended their advantage once again when Mariano raced away, and the crowd thought that they had scored another try on the hour mark, only for the referee rule it out.
Jamie Foster went over in the corner to see his side take an unassailable lead with less than 15 minutes remaining.
Lee Smith scored a last-minute Wakefield try which he converted himself to put his side within two points of the visitors, but it proved to be too late for a dramatic comeback.