Portion of a mesh with multiple material in the compositor

Hi guys, sorry for my english.
If I’ve got a mesh with two different materials, there is a way to get in the compositor a node with only the part of the mesh with a specific material?
I know that if I separate the mesh I can use the render layers and option “all z”, but I need to know if I can do it with a single mesh with two different materials.
I hope I was clear. Thanks:D

Can’t do what you describe afaik, but you can run your materials through nodes before the render.