Preston moved back into the top six of the Sky Bet Championship after a hard-fought but ultimately deserved 2-1 derby victory at Wigan, who remain in the bottom three.
Wigan, looking for a third successive win for the first time all season, came flying out of the blocks and had two big chances in the opening five minutes.
First Tom Pearce supplied Jamal Lowe, whose shot was tipped round the post by Declan Rudd. Then, from the resulting corner, Cedric Kipre found himself unmarked at the far post, only to completely lose the ball in the sun at the last second.
And Preston took full advantage by taking the lead in the seventh minute, thanks to a wonderful team move.
At the other end, a Johnson free-kick gave Maguire a free header, but he could only loop it straight into Marshall's hands.
Wigan would have gone into the break knowing they were fortunate to only be one goal down.
But within three minutes of the restart when Preston scored the second goal their dominance had undoubtedly warranted.
Again it was far too easy for them, with the Wigan defence stood watching as another fine move ended up with the ball at the feet of Johnson, who drilled past Marshall from 12 yards.
And the move paid immediate dividends with Gelhardt immediately laying on a goal for Wigan.
The England Under-18 star's cross from the left was cushioned by Moore, before Dunkley rifled home from close range.
Gelhardt then sent a left-footed strike just wide, despite having three defenders around him, as the visitors came under concerted pressure for the first time.
And Rudd had to be alert in the last minute to parry away a stinging strike from Gelhardt.