It's virtually impossible to say. At one time I made a complete list of the spells (in D&D terms) Gandalf had actually used over the course of the game, and it's actually pretty impressive. But even if Gandalf were a high level Wizard in D&D terms, there would be quite a few things which you can do in D&D which apparantly cannot be done by Wizards in Middle Earth - for example teleport. The other thing to consider is that Gandalf is not human, but in fact (in D&D terms) a celestial in disguise.
One consideration to make is that Gandalf was capable of facing a Balrog in single combat. How impressive this is depends on how potent you consider Balrogs to be, but certainly they were one of the most dangerous things in Middle Earth. If we assume that '20th level' characters existed historically (if not necessarily at the time of the ring war), then its pretty safe to assume that Gandalf's ECL is 20 or higher.
But really, this all depends on what game system you plan to use, what your particular preferences are as a DM, and so forth. Fifth level wizard is about as low as I've ever heard suggested, but its arguably possible depending on how you interpret various events. I personally wouldn't press for it, because he's at least the equal of the Witch King (at minimum Wraith + levels in some character class), and it would be extremely difficult to right up the Balrog in such a way that it was an overwhelming challenge for the whole Fellowship even though dozens of orcs were not and yet a 5th level wizard was its equal. On the other extreme, I've seen people suggest that not only was Gandalf epic level with suggested ECL as high as 30, but that so was Aragorn. I wouldn't push for that either.