I managed to solve my sprite masking issue by using the PixelDepthOffset parameter directly in my sprite’s material. This approach turned out to be much simpler and faster to set up than using Custom Depth or Render Layers.
By adjusting the PixelDepthOffset value, I was able to control the rendering order of my sprite and the 3D pole, creating the desired depth effect. A positive value for the part of the sprite that should appear behind the pole, and a null or negative value for the part in front did the trick.
This method is great for its simplicity, speed, and performance, although it might be less flexible for more complex scenarios.