Akinfenwa, 28, was a free agent after failing to agree a new deal at Sixfields, where he scored 17 goals in 40 League Two appearances last season.
He was on the verge of move to Southend but the Essex club were forced to pull out of the deal on account of Akinfenwa's wage demands.
The well-travelled striker, who is set do make his Gills debut in Thursday's friendly with Hearts, began his career with Watford before starring for Lithuanian outfit FK Atlantas.
League Two
Team news: Shrimpers hit by flu
18/11/2011 AT 12:54
His return to Britain featured spells at five clubs during the 2003/04 season including Rushden and Leyton Orient.
Akinfenwa then netted 14 times for Torquay in 2004/05 before scoring the winner for Swansea in the 2006 Football League Trophy final. His stint with Northampton began in 2008 and produced a total of 39 goals.
League Two
Team news: Southend missing Mohsni
04/11/2011 AT 12:26
League Two
Team news: Prosser pushing for start
28/10/2011 AT 09:02