Is there a way to render/export a z-depth map

Is there a way to render/export z-depth map that can be used to drive a DOF blur in photoshop or after effects?
I found a tute here http://lantios.deviantart.com/art/Z-Depth-Mask-Tutorial-in-DS3A-170794440 but it's for Daz 3. Anything easier in 4.6?
Comments
without buying anything else yes that would still be the way to do it...via Shader Mixer. If you have http://www.daz3d.com/atmospheric-effects-cameras-for-daz-studio then you can do it without the need to do it yourself. :)
Tried the shader mixing tute in Daz 4.6. Step 5 has changed, the menu path is now bricks/functions/utility/variable [root context]. I've added a comment there about it.
The zdepth function overrides normal rendering. How best might one get a matching normal render? Clone the camera? Turn something on/off to bypass the zdepth? It would be great if a normal rendering camera could update to match changes in the zdepth camera or vice versa.
Also some alternative to tweak-and-render testing to set the min/max distances would be nice. Oddly they seem not to correspond at all to the cameras DOF distances.
I noticed a depth shader in the Shader Builder, but have not tried it yet.