Calculating the x, y and z distances between two molecules - AMBER (Molecular Dynamics)
I ended up realizing that if you run:

parm prmtop-file
trajin netcdf-file
vector v0 :1-4@heavy-atoms-from-molecule-1 :5-8@heavy-atoms-from-molecule-2 out v0.out magnitude
run
quit


You will get the total distance as well as x, y and z distances between your two molecules. The output file will contain 8 columns. The AMBER manual states that they are identified as follows:

Frame | x-Vector-Coordinate | y-Vector-Coordinate | z-Vector-Coordinate | x-Origin-Coordinate | y-Origin-Coordinate | z-Origin-Coordinate | Magnitude

The vector coordinates are your x, y and z distances. Magnitude is the total distance.

Decided to share this as someone might run into the same problem one day.