I still feel more like an "advanced beginner" than an expert on Blender, and I don't have an answer for you (yet), but I think I know where to poke around. But I warn you that my experience is Blender 2.49 or so and I know that things changed wildly at 2.5 (I'm dreading transitioning to it).

You're going to want to create a material, and in the Shading panels, in the Material buttons, there's a Texture panel of some kind where you can specify the Map Input and Map To settings... You can use the Orco (I think! Orthogonal Coordinates?) input and map the Z to some color... You'll need to open the UV editor... and then you Bake the texture under the Render panels... I don't even know if these make sense in Blender 2.5. But it's something along those lines; I experimented with something similar a while back.

If I can figure out something coherent I'll try to get it back to you.