I've been running the mega dungeon campaign Rappan Athuk by Frog God Games using 5e for over three years now. I do use some third-party supplements to the rules and some rule variants, so I'm not running bog standard 5e. But most of that related to downtime activity and leveling, not the actually exploration, combat, and skill mechanics.
Some things that have made it successful in my opinion include:
1. It is truly a MEGA dungeon.
Large enough for distinct regions and factions.
2. Home base.
This starts in a small trading settlement fairly close to the dungeon that serves as a home base. Plus there is a ruined castle with rules for fixing it up (after defeating/allying with the current goblin inhabitants). It is mean to be taken over while still in tier one but needing significant gold to fix up, requiring more adventuring). Also, I use Matt Coleville's Strongholds & Followers rules, so their "home base" grows as they level, eventually becoming a village, than a town, etc. Gives a reason to spend money, a reason to care about the threat of the nearby dungeon, and lots of opportunity for political intrigue if the players are up for that.
3. XP for GP.
I have used certain events or accomplishments as milestones, but I basically use a simple rule of rewarding XP for treasure removed from the dungeon. This encourages a different play style than XP for killing.
4. Reputation rules (Renown/Infamy faction points).
Using homebrew rules modified from an ENWorld article, the PCs earn renown and infamy that result in various good and bad events and determine how different groups interact with them. This is also a way to reward PCs for defeating certain enemies or overcoming certain challenges that don't lead to loot.
5. It is still part of a larger world.
The PCs, especially in lower levels, would have to travel long distances to larger cities to sell certain very expensive items or to buy rare items. So dungeon delving would be punctuated with some side travels and encounters, plus city exploration. As they get to higher levels they needed to find and interact with more powerful actors and factions to buy/sell items, get support, hire forces to secure areas they cleared, etc.
If they want a break from the mega dungeon there was always the option of doing a side quest or even abandoning Rappan Athuk and adventuring elsewhere. Their is a LOT of content for the Lost Lands. So the players never had to feel that they were "stuck" in the mega dungeon. If they get bored with it, the game can continue with the same PCs. But, interestingly and a bit surprisingly to me, other than making runs to a city or a powerful NPC for trade, research, and politicking, the game has taken place almost exclusively in the Mega Dungeon. An average of about 10-12 hours a month (we play an 8-hour session once a month, but we have fairly frequently played twice a month, rarely missing a month, so I'm rough estimating about 10-12 hours). I'd have to check the calendar for the exact number of months, but I know it is over 3 years. Easily over 400 hours of play time in one mega dungeon, with a fairly slow level progression (most characters are at level 17 after over 3 years of play).