The performance gap between the two is generally low, usually between 5 and 10%. In other cases, however, the gap is massive, sometimes upwards of 30%. The 5800X is also a much better fit for your video card in terms of potential bottlenecking. It really depends on what you plan to do. If you will be staying on the AM4 platform for the next 3-4 years, it might be worth picking up the CPU. If you will switch to AM5 sooner than that, you might want to hold off. If you are still looking to upgrade, you should consider the 5800X3D. It is 100 dollars more, but the gap widens from an occasional 30% uplift to sometimes over 50%, on both average frame rates and 1% lows.
Remember that buying a more powerful graphics card will show a greater performance improvement over upgrading any other component, with an SSD upgrade being a rare exception. So it may be worth putting that money into a more powerful video card. Hope this helped, take care.
Mind you these "sometimes over" is usually on titles that are already well known to either not scale cores very well anyway due to various reason (Minecraft due to Java limitation, Star Citizen due to <Mod Edit> draw calls) or actually uses the cache like in Assetto Corsa Competizione. So yeah, do your research on whether 5800X3D is a good idea, if most of your regular titles wont see performance boost i would go for 5700X or 5800X, whichever is cheaper at the time assuming you have the capable cooler for all 3.