UE5 dev is extremely core hungry, with even two Intel e-cores adding the same uplift as a whole p-core in UE5 dev, while normally the relation is four e-cores for one p-core. Then it is followed by single-thread performance, but all Ryzen 5000 series fares similarly here (which is about 15%-20% better than yours).
Everything else in the CPU is kinda irrelevant outside play-testing, and for that you just need a CPU that can keep up with your GPU, which your current CPU more than does.
So I recommend you the 5950X (16 cores) by far. The 5900X (12 cores) should also provide an uplift if you need to budget. I do not recommend the 5700X or 5800X since both are 8 cores, you will not notice a significant uplift with UE5. The 5600X (6 cores) will slow down your UE5 experience, but can improve gaming with the extra cache.
If you cannot afford the 5900X, then honestly just save up for a better platform later and stick with what you have meanwhile, or pick a 5700X3D or 5800X3D for gaming and marginal (25%'ish) UE5 improvement.
If you do not have 32GB of RAM yet, consider upgrading that first, too, UE5 slowdowns heavily on 16GB as it uses your storage as RAM.