Southend United returned to the top of League Two as they held on for a narrow victory at the Priestfield Stadium.
Liam Dickinson fired Southend ahead on nine minutes with a low left-foot shot.
Paul Sturrock's Shrimpers then doubled the lead on the half hour when, from JP Kalala's low left-wing cross, the ball went in off home defender Joe Martin in a scramble of legs in the six-yard box.
Gavin Tomlin rifled a 15-yard shot into the top corner late on, but the home side were unable to force an equaliser.
Southend's victory ended a run of three defeats in four matches, but a fourth straight defeat for Andy Hessenthaler's Gills denied them the chance to return to the play-off zone.
VIEWS FROM THE TRAINING GROUND
Gillingham manager Andy Hessenthaler told BBC Radio Kent:
"It was the same old story in the first half, making errors and making it very difficult for ourselves.
"They're basic errors that shouldn't happen. When you're on a bad run, that's what happens.
"We're not seeing danger and we're getting punished for every error at the moment.
"You've got to give the boys a lot of credit and you've got to think about playing them. Maybe that's the route - get the young boys in and get them playing. They play with no fear, they give you everything and they listen."
Southend manager Paul Sturrock told BBC Essex:
"I think it proved tonight, that what I've tried to preach to these players works for us. The first half performance was different class.
"Everybody, to the letter of the law, played to the gameplan, and the boys worked very, very hard.
"We tired, which is always going to be a feature when you press so high up the football pitch.
"You've got to give credit to Gillingham, they changed a wee bit and tried to pass round us, so it made it more difficult."