The native Z Nikkor lens has electronic aperture, thus you cannot control the aperture if the lens is reversed and communication to the camera is lost.
Reverse-mounting an F mount lens would be easy, however. You need an ordinary reversal ring and some suitable adapter ending with Z mount to its rear. Adding some extension as well migt be beneficial in terms of optical performance.
In fact, any lens with non-electronic aperture can be used.
If required magnifcation is 5X or larger, probably the better approach is using infinity-corrected confocal setups not finite-focus lenses. The Mitutoyo metallurgical objectives are excellent for such purposes and allow (relatively speaking) long distance to the subject.