How to use a Custom Stencil to mask Exponential Height Fog?

The game I am working on involves ghosts, and I am working on an effect where if an invisible ghost steps into a volumetric light, the exponential height fog is affected by a mask so the model makes the room appear unlit within the boundaries of its silhouette. I know I will need to use a Custom Stencil to do this, but I don’t know how the post process material should work.