Former Yeovil man Huntingdon returned to haunt his former side as he headed Preston in front early on, before Gallagher secured the win in the final minute by slotting calmly past Artur Krysiak.
Preston went into the match full of confidence following their victory away at leaders Bristol City last weekend, and had to wait just five minutes to get on the scoresheet.
Gallagher’s corner found an unmarked Huntingdon in the box, and the former Glover was left with an easy header past Krysiak into the roof of the net.
Preston were gifted an opportunity to double their lead in the 19th minute when Gallagher pounced on Nathan Smith’s error and slotted through to Jermaine Beckford, but Krysiak dashed out to smother the danger.
Yeovil grew into the half as it wore on, and came closest when neat build-up play presented Sam Foley with a golden opportunity inside the box, but Thorsten Stuckmann was equal to the task.
Yeovil’s task became even harder when they were inexplicably reduced to 10 men shortly after the hour mark, when despite clearly winning the ball, Ryan Inniss was shown red by referee Darren Deadman for a lunge on Kyel Reid.
With the sending off went any sort of attacking threat for the Glovers, as the game began to peter out.
Preston looked the more likely side to add to their lead, and they made sure of the win in the final minute when Kevin Davies put Gallagher clean through on goal, and the one-time Scotland international eased the ball past Krysiak to make the game safe.