Zakuani, 31, was offered a contract by the Cobblers "subject to an agreement being reached on his international commitments", but left the club in May.
The DR Congo international, who made 25 appearances for Northampton, has agreed a one-year contract with Gillingham.
He is their third signing since the end of last season, after deals for defenders Luke O'Neil and Alex Lacey.
"We needed a talker and we needed a leader, and Gabriel's been identified as that," director of football Peter Taylor told BBC Radio Kent.
"He's still captain of his country, he still enjoys that, so there will be a couple of times we won't have him, but not many.
"We've made a good agreement with him that he's only going to be available for his country on certain games, and I think he's making that agreement with Congo."
Find all the latest football transfers on our dedicated page.
Gillingham have signed defender Gabriel Zakuani after he turned down a new deal with League One rivals Northampton.