how to move 3dcursor with axis constraint
To do this, you should first enable Face Snapping. Press the magnet icon to enable snapping, and open the drop-down menu and select Face. You can toggle snapping using Shift+Tab. Also, Ctrl+Shift+Tab can be used to bring up the snapping type menu.

From there, use the Cursor tool and press Z to lock the motion to the z-axis. Holding down LMB and hovering over the face of the cube will then move the 3D Cursor downwards to the face.
Tip: You can also move the 3D Cursor by pressing Shift+RMB.