The powerful striker opened the scoring after 25 minutes after former Sky Blues striker Cody McDonald was clumsily fouled by City captain Dan Seaborne when through on goal.
Following a long period of deliberation, referee Darren Sheldrake sent Seaborne off for denying a goalscoring opportunity.
The visitors deservedly levelled five minutes into the second half, as Callum Wilson also scored from the spot having been pushed by Leon Legge.
Myles Weston scored his first goal since April to put the Kent side back in front from a header, before Akinfenwa scored again from 12 yards after being knocked off the ball by Andrew Webster.
However, the drama had not finished, as Legge brought down Wilson in the box for the second time, and City substitute Carl Baker scored the game's fourth penalty.
Jake Hessenthaler then sealed back-to-back wins for the Gills for the first time under manager Peter Taylor with a 40-yard effort after City goalkeeper Joe Murphy has rushed off his line to deny the on-rushing McDonald.