Ocarina of Time in my opinion. I don't think it is particularly all that close either. Mario 64 is a fun platformer, but for some reason it always fails to hold my attention for more than a few hours. Controls are clunky and some levels are tedious. It is an AMAZING game, no doubt. But it has never really *clicked* for me in the way that it has for others.
Zelda OOT is my favorite game of all time, bar none. The game is intoxicating. The music, character development, story line, controls, combat, and emotions. It is in my view, a perfect game. The difficulty curve, time it takes to complete the game, complexity and intricacies of the dungeons, exploration, time travel element. The relationships between the characters is developed through the game. You develop an emotional and personal connection with the game itself, Link and the many wonderful characters in the game. The boss fights are memorable and fun. The game lets you explore and there are many side quests and branching paths that you can explore outside of the main quest.
There is no game that holds a candle to Zelda OOT, nor do I think we will ever see one. The depth of OOT blows Mario 64 out of the proverbial water.