How to render one part of model in front of a different, specific part of the model?

Is it possible to make a specific part of a model render in front of only one specific part? Like if I wanted to have a stylized face that’s inside the head to appear more cartoony and I only want it to show up in front of the head and get hidden by the hair.

I know I can use In Front to make it appear in front in the editor, but I want it to show up in the render too, but not through the hair, only through the head.

Yes- there’s a complicated way and an easy way.

The complicated way is view layers- you have at least three views layers (back, middle, front) and you composite them together by making them Holdouts of each other and using Alpha Over nodes.

The easy way is to download Goo Engine and use a Set Depth node on the thing you want in front

Thank you so much!