Matt Heath and Dion Dublin scored the goals to ease the pressure on Leicester manager Micky Adams.
However, the defeat leaves Gillingham boss Andy Hessenthaler with plenty to worry about as his side lost for the fourth successive time in the league at Priestfield and all without scoring a goal.
Leicester came into the game on the back of a collapse at QPR where they had thrown away a 2-0 lead and they looked nervous in the opening stages.
However, out-of-form Gillingham were little better as the two sides scrapped away with little skill for the first 20 minutes.
Eventually Leicester finally gained control and they almost took the lead when Nikos Dabizas powered a far-post header towards the top corner of the net. Gills keeper Steve Banks was alert, though, and tipped the effort round the post.
Leon Johnson then had to clear off the line for the home side as Dublin tried his luck with an acrobatic volley as the Foxes began to dominate.
But Kevin Pressman still had to be on his best form as Gillingham finished the first half and started the second with a flourish.
First the keeper made a double save from Nicky Southall's 25-yarder and Darius Henderson's follow-up header, before topping both those saves with a block which was out of the very top drawer.
Leicester were caught square by a quick break and Darren Byfield was left clear in the box to hammer Nyron Nosworthy's cross seemingly into the net from six yards. But Pressman made a miraculous save with his right hand to keep the scores level.
And the Foxes took full advantage by marching immediately upfield and taking a 48th minute lead.
Gillingham could only block James Scowcroft's far-post header from a corner and Heath reacted quickest to toe-poke the ball over the line through a forest of legs.
Leicester continued to push the home side back and it was no real surprise when they extended their lead after 71 minutes.
Trevor Benjamin was released down the left-hand side and Dublin met his cross perfectly and slotted the ball emphatically into the roof of the net to give Banks no chance.
And Gillingham suffered a final blow in the final minute when Southall was sent off for picking up a second yellow card for kicking the ball away.