Alan Browne's headed winner kept Preston in the play-off spots after coming from behind to defeat Hull.
Hull had the wind and the better of the first half but despite their start they did not have a shot on target until Wilks fired a left-footed effort at Declan Rudd.
At the other end Gallagher sent a perfect inswinging cross onto the head of Sean Maguire, who glanced wide.
Preston's best chance of the first half fell to Tom Barkhuizen. His header from Maguire's cross was well saved by Long and the Preston attacker fired the rebound over.
While North End grew into the first half in an attacking sense, their back line fell asleep just before the break.
A short corner routine, one that Hull had already tried before, ended with Callum Elder crossing for Wilks to nod in from close range.
While the home crowd expected a reaction after the break it was Wilks again for Hull providing the magic. His clipped cross to the far post was nodded across the face of goal by Magennis.
That sparked a reaction from the home team. Darnell Fisher snuck round the back and laid a ball across the six-yard box for Maguire, who diverted his close-range effort on target only to be denied by a stunning goal-line clearance by Reece Burke.
Fisher would be involved in a key piece of action moments later. From the very first whistle he and Magennis had a titanic battle. Fisher came out on the right side of it just after the hour when the Hull man clumsily brought him down in the area.
The referee pointed to the spot and Gallagher powered the spot-kick home.
Seconds earlier Hull had been lucky to get away with another penalty shout as Jordy De Wijs looked to have brought down Browne.
The home side looked a different team and were soon ahead. Jayden Stockley crossed for Browne who headed the ball back the way it had come from and past Long.
In an inspired change on the hour, Alex Neil had introduced both Stockley and Browne to the game in an attempt to swing the momentum.
In the closing stages, it was the home side who pushed to extend their lead, with Pearson and Gallagher sending efforts just wide.
But the one-goal advantage turned out to be enough for the home side, who condemned The Tigers to defeat and left them winless since New Year's Day.