He swiftly won a penalty with a smart turn and, when Matty Fryatt failed to beat Julian Speroni from the spot, followed in to score before clipping in a delightful second for Nigel Pearson's side.
Neil Warnock's Palace came into the game on the back of a five-match unbeaten run and began confidently, with midfielder Neil Danns seeing a low volley blocked after Foxes goalkeeper Chris Weale had flapped at a hanging free-kick.
The home side struggled to impose themselves on the game in the opening exchanges and relied on the ball to targetman Steve Howard all too often.
Palace were also preferring the direct route and nearly pulled ahead when Clint Hill's deep free-kick again caused chaos in the heart of the Leicester defence and Alassane N'Diaye was given space to flick a header narrowly wide.
Weale was having a tough time dealing with the long ball and clattered into his own team-mate Wayne Brown when coming unsuccessfully to claim another cross.
Leicester managed to clear and neither side managed to fashion any further chances as a tepid first half came to a drab end.
Pearson introduced former Blackburn forward Gallagher at the break and within 90 seconds he had the best effort of the evening.
Fryatt broke clear down the right after a decent pass from captain Matt Oakley and stood the ball up to the back post.
Gallagher showed admirable technique to meet the ball with an acrobatic volley but Eagles goalkeeper Speroni clawed his effort out.
Richie Wellens then slashed a shot wide from the edge of the box as the hosts made a far brighter start to the second period.
Gallagher was involved in everything and won his side a penalty in the 58th minute.
He played a smart one-two with Brown on the edge of the area and was tripped by Hill as he burst onto the return.
Fryatt stepped up to smash in a powerful effort which was well saved by Speroni, but Gallagher arrived first to sweep the loose ball into the net.
Gallagher called Speroni into action with an angled drive before adding a wonderful second in the 80th minute.
Danny Butterfield miscued a backpass and Gallagher took full advantage, lobbing Speroni from fully 30 yards.
Substitute DJ Campbell should have added a third late on but shot straight at Speroni as the Foxes moved to within three points of the top of the table.