You asked

Is the nikon z5 ii better than the nikon z5 for shooting in dim light?

The Nikon Z5 II is the newer body, but for dim light the difference is small. Both have a 24-megapixel-class full frame sensor (24.5MP on the Z5 II, 24.3MP on the Nikon Z5) and both stabilise in the body. The guide's Nikon Z5 II page gives no low-light figures, so this answer can't rank their high-ISO results. The sensor size is the same, which is what matters most in dim light, so the choice should come down to price and features rather than low-light performance.

For dim light, the lens matters more than the body. The lens aperture explanation shows why: f/1.8 gathers about ten times the light of f/5.6. On the Z5 II, the guide lists these fast primes:

Stabilisation steadies the camera, not moving subjects, so for people or sport in dim light a fast lens helps more than in-body stabilisation alone. If you shoot very dim, fast-moving scenes, a faster f/1.4 or f/1.2 lens would help more still. Check the lens pages for current prices.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.