Cane, 25, is set to play his 50th test against Australia this weekend in Brisbane and has captained the All Blacks in two tests.
The deal means he will also remain with Super rugby side the Chiefs.
"Even though I've been in the All Blacks for five years now, there is still heaps more I want to achieve in the black jersey," said Cane.
"I'm in a leadership role with the All Blacks and the Chiefs and that's something I enjoy, and I want to contribute any way I can in helping lead and drive both those teams to succeed."
The All Blacks coach Steve Hansen said "he's still a young man and knowing that he's staying through to 2021 is fantastic for the long-term growth of the All Blacks and his experience and knowledge will be invaluable to the team in the years to come."