Lets say your second Z axis, I’ll call it ZA axis, has its stepper directly connected to a 2mm pitch lead screw. To move 10mm, you would need 5 revolutions.
So, a G1 A1800 (5×360 degrees=1800) Gcode command would move your ZA axis 10mm. You have to experimentally determine if you want a G1 A1800 or G1 A-1800 to move in the direction you want
I am not aware of any Gcode generator that would generate this for you, you will have to hand code.