Below you can see the front-view size comparison of the Nikon D5 and Pentax 645Z. The Pentax 645Z is 4 mm narrower and 42 mm shorter than the Nikon D5 but it is also 31 mm thicker.
The chart below depicts how two cameras compare with average dimensions of the cameras in their class.