Not sure exactly what numbers Z depth uses, but from the sounds of it you might want to use the Mist Pass instead, which performs a similar role but it allows you to set a custom start and end point which it converts to the 0-1 range.
You can set the Miss Pass by enabling it in the Layers properties, then setting the start and end point in the World Properties
As it is a floating-point value, and not an actual color, I believe that it is storing the actual value for the distance in each pixel.
You can ‘normalize’ these values with a compositing node, so the closest value maps to zero, and the furthest maps to one. This has the side-effect of all the values shifting around as objects move around in the scene, and the distance for the closest and furthest point change.
You can get a more predictable (and less jagged) depth map by using the Mist Pass, and controlling the near and far points via the World tab in the Properties view.