Marlon King's 19th goal of the season condemned Millwall to their fourth straight defeat and further dented their First Division play-off hopes.
The Gillingham striker scored the only goal of the game in the 69th minute, sliding in at the far post to meet Ty Gooden's low cross. Christophe Kinet was sent off with 10 minutes remaining, as four other Millwall players were booked on a frustrating afternoon for Mark McGhee's men.
The Lions started brightly, and the midfielder Paul Ifill was first to test Jason Brown in the Gillingham goal with a drilled shot from the edge of the box. Moments later Millwall earned a free-kick 35 yards from goal. Kinet tried his luck with a curling attempt, but Brown was never in trouble and made an easy save.
Gillingham, who lost in midweek at Norwich, gradually began to exert some pressure on Millwall's rearguard and looked most likely to break the deadlock as they continued to pile forward. Paul Shaw had another effort saved by Tony Warner after 27 minutes, and the same player was denied a certain goal on the half-hour by a last-ditch block from Sean Dyche.
After surviving a lengthy spell of Gillingham pressure, however, the visitors almost took the lead with the best chance of the first half. A long goal-kick from Tony Warner found its way to Tim Cahill. The forward let fly with a piledriver from 20 yards, but Brown tipped his shot round the post.
The second half started badly for Millwall, as defender Ronnie Bull left the field with what looked to be a serious injury.
King spurned a good chance in the 65th minute, as Gooden's dangerous corner found its intended target at the far post – but the striker hit a weak shot over the crossbar. The forward had to wait only four more minutes to make amends thanks to more good work from Gooden.
Millwall had hardly threatened since the restart – and their frustrations became apparent as Cahill's name was added to Ifill, Bull and David Livermore in the referee's notebook.
Temperatures finally boiled over a minute later, as Kinet was shown a straight red card for a dreadful challenge on Nayron Nosworthy.
It was the visitors who had the better of the closing stages, however, as Cahill had a header acrobatically tipped over the crossbar by Brown.
Goal: King (69) 1-0.
Gillingham: Brown, Hope, Butters, Perpetuini, Nosworthy, Smith, Gooden, Browning, Shaw (Saunders, 89), King, Ipoua (James, 84). Substitutes not used: Bartram (gk), Edge, Ashby.
Millwall: Warner, Livermore, Nethercott, Bull (Ryan, 53), Dyche, Reid, Cahill, Kinet, Ifill, McPhail (Harris, 67), Claridge. Substitutes not used: Guéret (gk), Ward, Green.
Referee: P Dowd (Stoke-on-Trent).
Bookings: Gillingham: Browning. Millwall: Ifill, Bull, Livermore, Cahill. Sending off: Millwall: Kinet.
Man of the match: Gooden.
Attendance: 8,082.Reuse content