While I'm not a big believer in the martial/caster divide, I think the two simple things you could do is remove cantrip scaling and use more encounters per long rest. Using either of these will make casters "weaker" without upsetting their overall balance (or fun), while using both should all but negate the divide.
IMO cantrip scaling was a huge mistake. It allows the at will power of casters to stay competitive with martial attacks, while the casters continue to gain spell slots. It first came to me when I realized at at 11th level, you're almost always better off casting a cantrip than a 1st level combat spell. Even at 5th level, a cantrip is still often better against a single target, allowing the spell slot to be used for utility or defense. By making higher level casters use low level spells instead of cantrips, it depletes the number of spell slots available for other things.
Too many DMs use way too few encounters per long rest. The 2014 rules had a rough guideline of 6-8, which was routinely ignored, and the 2024 rules don't even provide that. IME, tier 1 characters can handle about 4-6 medium encounters pretty well, tier 2 characters the assumed 6-8, and tier 3 characters 8-10. I had some experience with epic characters, but it's hard to say how many they could handle. While you could use more hard/deadly encounters, this favors casters who can go nova more readily, so a variety is best. More encounters takes away the advantage that casters have of having more spell slots, so that when reduced to cantrips/low level spells, the martials will do much better by comparison.