Ehmmm... Check out minimole. You can set up a scene and use a depth color material. This is for getting a depth map on the screen. In your case, you might have to render to a texture instead and then access the data in some way that doesn't come to my mind right now... sorry! Rendering to a bitmap data is dead slow, so I would avoid that.
Alternatively, I know Broomstick works with depth maps already, but I'm not sure how yet.
