The most important thing to say right off the bat is that Megaman is one of the best gimpers in the game, if not the best. And we Diddies are especially vulnerable to being gimped. For that reason, in this matchup, try to avoid recovering low if at all possible. Very quick light hits like nair, fair, metal/shadow blade, and the shield variants are murder for low Rocketbarrel recoveries. If you get caught recovering low and Megaman's got a good position to intercept, expect to have the barrels tapped off you, or worse, get hard knuckle'd.
Megaman is also, obviously, one of the best long-range fighters in the game, having a ton of options to cover both horizontal and vertical distances, but for the most part, lacks the tools to reliably get someone off him. The best way to approach customs-off Megaman is from a 45 degree angle, as he doesn't have anything to defend that angle from other than an angled metal blade. When customs are on, Danger Wrap can cover this blind spot a bit more reliably for him, but at the expense of some of his horizontal pressure, making it a bit safer to approach a Danger Wrap MM from the side. Vertically, Megaman has air shooter and hard knuckle to cover those two angles, but both, Hard Knuckle especially, are unsafe if dodged while close up, and can easily be punished. When he's got customs on, however, watch out for Tornado Hold, as it covers a good distance below him, and sets up for some nasty combos.
Bananas are especially important this matchup, as Megaman often relies on having a constant wall of projectiles to keep his opponents at a comfortable distance. A well timed banana thrown from a low jump will avoid Megaman's projectile wall, and if it hits, will usually stop said wall for long enough for us to get good and comfy in his face. Once you're there, it's also not a bad idea to have a banana lying around as insurance, as one of Megaman's best escape tools, D-Tilt, is stopped by banana, allowing for us to keep on him. Be cautious of Megamen running Skull Barrier however, as it's reflecting comes up deceptively quick, and can capitalize hard on a poorly timed banana. Popgun also comes at Megaman through his blind spot, but is less effective at stopping him and more risky.
Offstage against Megaman is risky for both players. Always recover high if you can against Megaman, for reasons stated above, but be wary of stuff like air shooter and danger wrap that will try to catch you for doing so. For Megaman, however, his recovery, for all three customs, is very limited and predictable. Rush is his fastest recovery, but is very predictable, and because of it's less than stellar horizontal movement and the fact that he can bounce off a still-falling rush, is probably best countered with something to send Megaman off to the sidelines again, where, minus a double jump, he can't do much to save himself. Beat gives him more horizontal mobility, but is far slower, and he can't act out of it nearly as fast. Definitely pull out the meteors against a Beat user, as it leaves him open, doesn't go as high, and he cannot get a second bounce off it. Tornado Hold is one to be wary of, because although it doesn't have the height or horizontal movement of his other two options, it has some deceptively wide hitboxes, and can cause some really nasty surprise stagespikes.
Overall, both characters occupy very different distances that they're best at, and excel when they've got their opponent at the distance they want. It's going to be a very polarizing matchup, and the outcome will really mostly depend on who can better get the positioning they want. For that reason, I think the matchup is right around even 50-50, although I can see arguments being made for it to be in either's favor. Definitely not a bad matchup, just one to play more cautiously than most. This applies for both Customs-Off (C-F) and Customs-On (C-N) matchups as well, because most likely we'll be running an unchanged Diddy, and Megaman's custom options aren't strictly better, but just lead to different playstyles niches and coverage, whilst also losing him some coverage in other areas (ala Skull Barrier reflecting bananas, but also losing him the hits from Leaf Shield/Plant Barrier for gimping/grabs).
For stage choice, Duck Hunt is a good pick if it's not striked out, as the ducks can interrupt Megaman's projectiles and give us a chance to get in, whilst also having some close sideways blastlines, as well as flat walls to prevent surprise stagespikes. The platforms, especially the bush on the right, are good vantage points, or for a breather, as they're angled at a bad angle for Megaman, provided he's not directly below/parallel to you. Traveling stages like Wuhu, Skyloft and Delfino are also good picks, as they make Megaman's spacing game more difficult due to the changing layout.