No problem, that was just the easier of the solutions. I did some digging and found what you are looking for is a Custom Depth material.
One of our content creators here at Epic put together a great page, all about the power of Custom Depth. Take a look at it, and I am sure you will find the correct process.
The Many Uses of Custom Depth
Let me know if you still have questions.
Cheers,