I'm not sure it's possible via the modding APIs exposed by UT2004. If it is, the information is likely on the UnrealWiki or someplace similar -- perhaps ask in the IRC channels listed on that wiki's main page, as well?
Likely the information you will be found under information for framebuffer access or post-processing graphics mods, but I'm not sure if the particular flavor of Unreal Engine used for UT2004 (2, I think?) exposed this kind of thing.
There is another option though. This question about accessing another process's device context deals with API hooking, and has a few answers that may be helpful. With this approach, rather than write a mod, you write an external program that hooks UT2004's Present()
call (or similar), does the normal presentation work, and rejiggers the scene setup to re-render it with depth pass into a texture you've created and can write out to your sensor.
Unfortunately this is an exceedingly complicated process relative to simply using something in the UT2004 mod arsenal. Perhaps instead you could post another question detailing the requirements and implementation of your raycasting technique, and ask if there's a more efficient way to achieve your ultimate goals?