Callum Robinson scored a late winner for Preston to seal a hard-fought win over rivals Blackburn at Deepdale on Saturday evening.
Daniel Johnson had opened the scoring with a stunning curling effort (18), before Danny Graham netted an equaliser (22) after his initial penalty had been saved by Chris Maxwell.
Johnson stroked home his own penalty when Simon Makienok was impeded by Darragh Lenihan (31), but Graham grabbed a second when he guided home Derrick Williams' forward pass (69).
Blackburn piled on the pressure in the final quarter of the game, yet for all their possession, it was Preston who came away with the points when Robinson finished off a Greg Cunningham's cross from close range.
Both sides came into the tie with two wins from their last six games, but Preston were significantly weakened without Eoin Doyle and Jermaine Beckford after their antics in the defeat to Sheffield Wednesday last Saturday.
That was on paper, at least. Preston looked the stronger side from the outset; Marnick Vermijl wasted an early cross that he erratically smashed across goal, while Ben Pearson's volley struck the hand of Charlie Mulgrew and diverted away.
Winger Robinson stuck out as the most dangerous attacking outlet from the whistle, though, and his tenacity on the flank played a starring role in the game's opening goal.
Under pressure from Jason Lowe and Ben Marshall, Robinson squeezed a low cross past the pair that was picked up by Jordan Hugill on the edge of the box; he brought it under control and laid the ball off to Johnson, who concluded the move as he beat Luke Steele with a stunning curling effort.
Yet just moments later, Johnson went from zero to hero when he inadvertently brought down Gallagher in his own area; Kevin Friend was left with no choice but to award a spot kick.
Graham's initial spot-kick was saved, Maxwell saved the rebound, but could only push it in the direction of Gallagher who returned the ball to Graham; the seasoned striker lashed in an equaliser from close range.
The game was beginning to come to life and, less than 10 minutes later, Johnson had the ball on the spot at the other end after Lenihan had clumsily handled the ball, taking it away from the head of Makienok; confidence bolstered by his earlier goal, Johnson stroked the spot-kick past Luke Steele to restore the lead he had played a part in sacrificing.
Graham almost made it 2-2 in first-half stoppage time, but his looping header was splendidly kept out by Maxwell at full-stretch.
Preston carried their dominance into the second half, and stayed in the lead thanks to a fantastic refereeing decision by Kevin Friend; Corry Evans fell at the feet of Pearson in the box, but it was adjudged to be simulation, not the foul Owen Coyle's reaction suggested had taken place.
Blackburn finally brought the game to their opponents around the hour mark, with Bailey Wright earning his keep with some excellent defending to firstly block the shot of Craig Conway and moments later, Graham.
And after 69 minutes, they finally had the equaliser they deserved. Williams created space and advanced down the left before finding Graham with a through-ball; the striker let the ball run across him, hold off Tom Clarke and score his second of the night and fifth in five games.
Preston had lost their grip on the game, but with ten minutes to play, they grabbed a much-needed winner through the Robinson; Cunningham had done very well to advance into the box and find the winger, who intercepted the pass and fired home his fifth of the season from close range.
Much of the added six minutes were spent by Preston keeping the ball in the corner, meaning Blackburn had little opportunity to equalise and a last minute substitution from Simon Grayson meant any little chance was reduced to nigh-on impossible; Preston move up to 12th.