Rotherham United manager Steve Evans was left thrilled after a seven-goal thriller which secured the Millers a League One play-off spot.
Substitute Tom Hitchcock scored a second-half hat-trick as Rotherham twice came from behind.
Kieran Agard put the Millers ahead after 14 seconds before Adebayo Akinfenwa equalised and Myles Weston nudged the Gills in front.
On-loan Hitchcock levelled for Rotherham only for Bradley Dack to put Gills back in front.
Hitchcock equalised before he completed his hat-trick in stoppage-time with a curling lob.
“It’s a game that’s had everything isn’t it,” Evans said.
“We score after 14 seconds and what a move that is with one and two touch passes.
“The crowd are as quiet as I’ve ever known it at the Rainham End and we have some good passages of play.
“We conceded a couple of sloppy goals today and we don’t get those individual errors but we’ve got the spirit and tenacity that not many teams have.
“A lot of your substitutions as a manager you get wrong, but we put Tom Hitchcock on and I think it could be my best of all time.
“It was a fantastic hat-trick with three excellent goals and he went on early in the game because we just needed something a bit different.
“He looked sharp in the reserves on Monday and looked sharp when I took the strikers yesterday and it was a tough call not to start him.”