Render to a separate buffer than the one that is sent to screen?

I need to get the colour of the meshes that are rendered even if they are occluded by other geometry. I can ask it to render to a custom DEPTH buffer, but that just gives me the outline of the mesh and not the colour of the mesh when rendered. Using stencils also does not seem to work because I have to manually set the colour based on the stencil ID.

What I need in the post processing material is a way to render the object with an outline that matches the colour of the object. A yellow mesh gets a yellow outline, a red mesh get a red outline.

That is why I would love to be able to render to a buffer that I can access afterwards in the PostProcess material, but I can not find any info on any such functionality.