Simeon Jackson's first goal for Gillingham handed his side three priceless points and left Bournemouth staring down the barrel of relegation.
The visitors had a late chance to level but Max-Alain Gradel saw his penalty brilliantly saved by Derek Stillie.
Both sides went into the game knowing that a defeat would place a severe dent in their survival hopes. It was the home side that made the dream start after only nine minutes when Cherries goalkeeper David Forde could only parry Andrew Crofts' deflected shot into the net.
Jackson missed a golden chance to double Gillingham's lead 15 minutes later - denied by Forde's legs - but in the 26th minute the lively striker broke his duck when he latched on to Adam Miller's fine pass, span past two defenders before calmly beating the Cherries keeper.
The two-goal cushion lasted barely a minute though as Bournemouth broke through Ivory Coast winger Gradel, who crossed for Jo Kuffour to tap home unmarked at the far post.
Gradel opted to switch wings shortly afterwards and proceeded to tease the Gillingham defence with his box of tricks.
In the 64th minute the winger dug out a perfect cross that Sam Vokes met with a towering header only for Stillie to produce an excellent save, tipping the ball onto the angle of post and bar.
The visitors continued to push for an equaliser and, with ten minutes remaining, Garry Richards grabbed Vokes' shirt in the area and the referee pointed to the spot.
Gradel stepped up to take the penalty but, despite his placing his shot towards the bottom corner, Stillie was able to make the save and the ball was frantically cleared. The goalkeeper excelled himself again three minutes later to deny Kuffour as the Gills held on for a crucial win.