It maintains their position in the top six and moves them to within two points of pacesetters West Brom and Newcastle.
Wednesday had enjoyed much the better of the opening period and were unfortunate not to earn at least a point from an entertaining clash.
The Owls started brightly, with Lewis Buxton's low shot forcing a save from visiting goalkeeper Andy Lonergan in the first minute.
Jermaine Johnson nodded over from a Gray corner and Leon Clarke forced a wonderful reaction save from Lonergan as the home side continued to dominate the early exchanges.
At the other end, Preston almost took the lead when Mark Beevers diverted Ross Wallace's cross narrowly over his own crossbar.
Lonergan made another fine stop to deny Luke Varney in the 11th minute before Mellor put Preston ahead against the run of play in the 20th minute.
The former Liverpool man met Eddie Nolan's cross with a left-footed strike which deflected off Darren Purse before nestling in the bottom-right corner.
Wednesday responded well and were incredibly unlucky not to level in the 29th minute as Johnson struck Lonergan's left-hand post with two shots in succession.
Gray did equalise nine minutes later with a sublime curling free-kick before the hosts hit the post yet again in first-half injury-time through Purse's volley.
Preston improved after the interval and edged ahead for a second time in the 55th minute as Parkin grabbed his fourth goal of the season - the burly forward side-footing home from close range after a neat cutback from strike partner Mellor.
Varney saw another effort deflected wide and James O'Connor directed a header off target from Johnson's cross, but Wednesday were unable to exert sustained pressure on their visitors, much to the frustration of the home supporters.
Preston could have extended their advantage in the closing stages, with Mellor curling a shot narrowly wide of Grant's right-hand post and Darren Carter coming close with a volley from Wallace's corner.
However, it mattered not as the visitors held on to claim a valuable three points.