Keanu Marsh-Brown crashed into Scott Laird in the 13th minute and referee Ross Joyce brandished a straight red card.
Preston took advantage immediately when Tom Clarke headed past Graham Stack from Lee Holmes' 18th minute right-wing cross.
Joe Garner doubled North End's lead in the 36th minute when he placed a header past Stack from Laird's left-wing cross.
Preston added a third in first-half injury time when Holmes found Gallagher, who slotted calmly home.
But the League One side were reduced to 10 men thanks to Stuart Beavon's late 56th minute challenge on Andy Yiadom.
Gallagher added his second with a 68th minute strike after good work on the right by Holmes.
And Gallagher sealed his hat-trick by beating the offside trap to clip over a 79th minute finish, while Garner completed the rout three minutes later with a low strike past Stack.