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."
Full Time The final whistle goes and the game is over.
Shot by Curtis Weston. Blocked by Jack Sampson.
The assistant referee signals for offside against Jack Sampson. Indirect free kick taken by Paulo Gazzaniga.
Curtis Weston takes a shot. Save by Glenn Morris.
Ryan Hall gives away a free kick for an unfair challenge on Gavin Tomlin. Jack Evans takes the free kick.
Curtis Weston provided the assist for the goal.
86:07 Goal scored
Goal! - Gavin Tomlin - Gillingham 1 - 2 Southend Gavin Tomlin scores a goal from just inside the penalty area to the top right corner of the goal. Gillingham 1-2 Southend.
Corner taken by Danny Jackman from the left by-line, clearance by Bilel Mohsni.
Paulo Gazzaniga takes the direct free kick.
Substitution Jack Sampson comes on in place of Liam Dickinson.
Booking Booking for Liam Dickinson for unsporting behaviour.
Liam Dickinson gives away a free kick for an unfair challenge on Garry Richards.
Ryan Hall produces a left-footed shot from just outside the box that goes wide left of the goal.
Liam Dickinson gives away a free kick for an unfair challenge on Connor Essam. Paulo Gazzaniga restarts play with the free kick.
Ryan Hall gives away a free kick for an unfair challenge on Garry Richards. Paulo Gazzaniga takes the free kick.
Gavin Tomlin is flagged offside by the assistant referee. Glenn Morris restarts play with the free kick.
Substitution Connor Essam is brought on as a substitute for Andy Frampton.
Jack Payne concedes a free kick for a foul on Bilel Mohsni. Direct free kick taken by Michael Timlin.
The assistant referee signals for offside against Liam Dickinson. Paulo Gazzaniga restarts play with the free kick.
Bilel Mohsni produces a right-footed shot from a long way out which goes wide left of the goal.
Substitution Ryan Hall is brought on as a substitute for David Martin.
Gavin Tomlin takes a shot. Save made by Glenn Morris.
The assistant referee signals for offside against Liam Dickinson. Paulo Gazzaniga takes the indirect free kick.
Luke Prosser challenges Jo Kuffour unfairly and gives away a free kick. Jack Payne takes the direct free kick. Gavin Tomlin fouled by Michael Timlin, the ref awards a free kick. Free kick taken by Danny Jackman. Danny Jackman produces a drilled left-footed shot from 25 yards. Chris Barker gets a block in.
Unfair challenge on Garry Richards by Michael Timlin results in a free kick. Garry Richards takes the free kick.
Curtis Weston challenges JP Kalala unfairly and gives away a free kick. Chris Barker takes the direct free kick.
Headed effort from deep inside the area by Garry Richards misses to the right of the goal.
Handball decision goes against Chris Barker. Jack Payne takes the free kick.
Danny Jackman takes the free kick.
Booking Kane Ferdinand goes into the referee's book.
Kane Ferdinand gives away a free kick for an unfair challenge on Jack Payne.
Inswinging corner taken left-footed by Danny Jackman from the right by-line, clearance by Chris Barker.
Effort on goal by David Martin from outside the box goes harmlessly over the bar.
The referee gets the second half started.
Substitution Jack Evans replaces Matt Lawrence.
Substitution Lewis Montrose leaves the field to be replaced by Jack Payne.
45:00 +1:06 Half time
Half Time The ref blows to signal half-time.
Unfair challenge on Kane Ferdinand by Lewis Montrose results in a free kick. Free kick crossed left-footed by Michael Timlin, clearance made by Garry Richards.
Foul by Liam Dickinson on Garry Richards, free kick awarded. Direct free kick taken by Garry Richards.
Foul by Lewis Montrose on Kane Ferdinand, free kick awarded. Michael Timlin takes the free kick.
JP Kalala takes a shot. Blocked by Jo Kuffour.
Andy Frampton fouled by Liam Dickinson, the ref awards a free kick. Paulo Gazzaniga takes the free kick.
Assist on the goal came from David Martin.
30:11 Goal scored
Goal! - Joe Martin - Gillingham 0 - 2 Southend Joe Martin scores an own goal from 6 yards. Gillingham 0-2 Southend.
JP Kalala concedes a free kick for a foul on Lewis Montrose. Free kick crossed by Danny Jackman.
JP Kalala challenges Lewis Montrose unfairly and gives away a free kick. Free kick taken by Curtis Weston.
Effort on goal by Lewis Montrose from 25 yards. Save by Glenn Morris.
Bilel Mohsni concedes a free kick for a foul on Andy Frampton. Paulo Gazzaniga restarts play with the free kick.
Inswinging corner taken left-footed by Danny Jackman from the right by-line, Bilel Mohsni manages to make a clearance.
Liam Dickinson gives away a free kick for an unfair challenge on Matt Lawrence. Garry Richards restarts play with the free kick.
Curtis Weston sends in a cross, blocked by David Martin.
Gavin Tomlin fouled by Kane Ferdinand, the ref awards a free kick. Danny Jackman takes the direct free kick.
Shot by Bilel Mohsni. Save by Paulo Gazzaniga.
Assist on the goal came from Kane Ferdinand.
9:47 Goal scored
Goal! - Liam Dickinson - Gillingham 0 - 1 Southend Goal scored by Liam Dickinson from close range low into the middle of the goal. Gillingham 0-1 Southend.
Liam Dickinson is caught offside. Paulo Gazzaniga restarts play with the free kick.
Unfair challenge on Michael Timlin by Curtis Weston results in a free kick. Glenn Morris takes the free kick.
Corner taken by Danny Jackman from the right by-line, Chris Barker makes a clearance. Danny Jackman takes the outswinging corner, JP Kalala makes a clearance.
The official flags Liam Dickinson offside. Garry Richards takes the free kick.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.