How to draw Outline Mesh over certain meshes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dlean Jeans

The outline mesh was created automatically in the engine with Mesh > Create Outline Mesh... with an material with No Depth Test flag enabled.

I want the green outline mesh to be drawn over only the wall but not the black pistol which is half covered below: