Leicester City 2 Crystal Palace 0
Gallagher, a half-time replacement for Lloyd Dyer, pounced in the 59th and 81st minute to light up what had been a dour encounter.
Patrick McCarthy came to the Eagles rescue in the second minute when he intercepted a Matt Fryatt cross with Steve Howard waiting to pounce at the far post.
But the game was half an hour old before the next meaningful goal action when Alassane N'Diaye rose above the home defence to head Clint Hill's long free-kick just wide.
At the other end Matty Oakley's header from a Dyer cross lacked sufficient power to trouble the keeper.
Just before the break, debutante full back Ryan McGivern crashed a 25-yard free kick narrowly over.
Dyer made way for Gallagher at half time and the substitute made an instant impact by forcing Julian Speroni into an acrobatic save at the far post after a quality cross from Fryatt.
And it was Gallagher who made the breakthrough for City on 59 minutes after he won his side a penalty when he was fouled inside the box by Nick Carle.
The Palace keeper dived to his right to beat away Fryatt's spot kick but Gallagher reacted quickly to hammer the loose ball into an unguarded net.
Chris Weale preserved the Foxes lead on 67 minutes with a sprawling save to keep out Danny Butterfield's deflected shot.
Gallagher hit back for City when he twice tested the Palace keeper from distance in as many minutes.
And it was he who sealed the points on 81 minutes with a spectacular second strike when he seized on a Butterfield blunder to beat Speroni with a superbly flighted chipped shot from 30 yards.