The 40-year-old has skippered Inter since 1999, but has claimed that he "was about" to join Los Blancos before taking on the responsibility.
"I was about to leave, for a very important team in Spain, such as Real Madrid," Zanetti told Videonews.
"But if I had to leave, I wanted to leave a mark for Inter. Then I was given the captain's armband and it was a beautiful responsibility. Everything that came after that was something extraordinary."
Zanetti returned from a long-term Achilles injury against Livorno at the weekend.