More on KentOnline
A late strike from substitute David Perpetuini earned 10-man Gillingham a valuable league win against Palace.
Perpetuini gathered a cross at the edge of the box in the 84th minute and fired a low, angled drive into the far corner.
Gillingham had keeper Jason Brown to thank for still being on level terms before Perpetuini's goal.
Brown had saved a penalty from Dougie Freedman in the 55th minute after Chris Hope had brought down the Palace striker in the box.
Hope received a red card for the foul and Gillingham had to dig deep for the rest of the game.
But they did more than hold on and, after taking the lead, both John Hills and Mamady Sidibe came close to making it 2-0.
The win brings to an end Gillingham's run of four succesive league defeats.