Generally, my mindset is if I'm exchanging two of the three platform parts at the same time, it usually doesn't make sense and you may as well just change the third and make it a whole platform change.
That being said, there are exceptions to that, such as if the platform is newer/performant enough already (most recent or second most recent) and if the cost is low. Both seem to be the case here.
Keep in mind that while DDR5 can help the 12th generation+ CPUs perform better, the big advantage of DDR5 over DDR4 is probably the extra bandwidth, and that's not usually as important to games as low latency is. You'll see some difference in some games, but this advantage will more be in general applications that are bandwidth limited. So if you're merely after better game performance, then skipping the idea entirely might be abetter way to allocate that $300.