Creating a wig asset (transparent head)

I‘m not sure if DAZ3d has the capability to do this...
I want to render some assset. E.G. a bald character asset with a transparent and some wigs for this head of the charakter.
If I add hair to character and make the head transparent, the result is that the hair is complitly visible. But what I want that where the invisible head is the hair is not viisble too (cropped out).
Is this in DAZ possible?
I cloud set head color green or black and remove the head in photo shop. But the result is not ideal and it‘s time consuming.
Comments
I found this article:
https://www.daz3d.com/forums/discussion/16878/compositing-shader-how-to-render-object-to-alpha
This is excactly what I'm searching, compositing a shader to alpha channel.
5 years ago it was not possible, is there in the meantime a way?
If not @daz-team this would be nice feature for future updates
In 3Delight you could use pwCtach to make the head show the background but mask the hair behind it.
In Iray you could use an Object ID Cnavas to generate a mask (Advanced tab of Render Settings).
Thank you! This is THE solution.
Unfortunately it seems not be possible to get the shadow thron by the hair into hair image. Menas that they are no hair shadows, if I combine both pictures again. But I think it's good enough. The shadows are only a nice to have for me.
I attach the pictures of my little experiment and a small tutorial (iray) for people who are interested.