It may seem like its an odd paring but they are both very similar.
Both are really smart. Both have fought against overwhelming odds. Both are truly loved by their companions. Both also tend to leave behind their companions often and are at times willing to sacrifice them for the greater good. Both have died and been resurrected.
Now this is just a one on one battle. No bringing in companions. But they have full use of all their abilities. Gandalf is at the height of his magical powers and the Doctor has full use of all his toys psychic paper/Sonic Screwdriver/TARDIS etc. And lets say for the sake of it its the 10th Doctor.
Who wins.
Let the battle begin.