This is simple. For a gaming focussed build, get the better gaming CPU, that's the 9800X3D.
For gaming, it will always be faster than a 9950X when the CPU is limiting performance in any way. When pushing against any games CPU bounds, be it max FPS, min, avg, 1% lows and stutter etc, the X3D will provide better results. The only thing a many core CPU will do better is give you a shorter shader compilation at first boot/new drivers.
I can say from my own personal experience, moving from a 5800X3D to 9800X3D felt like a large uplift even with a 3080, targeting 4K too. Every single game played better, some by a significant amount, it was so starkly obvious that everything about the game was smoother.
To me this is a no brainer. You don't talk about productivity work, just the extra cores, which will not give a gaming benefit that exceeds the benefit of the VCache.