Gillingham fought back from a goal down against Barnet to pick up a fourth consecutive League Two win.
The Bees' Clovis Kamdjo guided Ricky Holmes' cross in at the near post.
Dennis Oli scored an impressive equaliser when he ran down the right and buried a low shot, while Jordan Obita tapped in for 2-1.
Charlie Lee finished off Ashley Miller's neat pass to seal the win, but the hosts did lose Garry Richards, who went off with a suspected broken leg.
VIEWS FROM THE DRESSING ROOM
Gillingham manager Andy Hessenthaler told BBC Radio Kent:
"I'm very proud of them because of the problems we've got with injuries and illness.
"We said at half time we were still in the game and it had been a shame to give the goal away. It was a poor goal and their only real chance in the first half.
"But the longer the game went on, we came into our own. You've got to give Dennis (Oli) so much credit as he's come on and shown everybody that he's alive and kicking.
"I'm sure there were some parents in the crowd that were very proud of their sons because they were a credit to their football club."