I believe MegaPOV  http://nathan.kopp.com/patched.htm has this capability through postrender{depth} or something like that

Sean Brennan wrote:

Hi All,
    I know povray can produce image output.
How about outputting the zbuffer too?
I can't find any information on this, but it
would be super cool if I could get both
the image and the zbuffer output files.
Please e-mail:
    sean@adsl-63-192-208-124.dsl.snfc21.pacbell.net
if you have any ideas.

Thanks,
Sean