Rendering overlap bug

I guess this belongs here even though I’m just using default graphical setting. I’m making a 2D game using a perspective projection, so I have the objects close together along the Z axis to avoid the parallax messing up the view. The problem is that at certain angles the depth doesn’t seem to matter, for example the gun rotates to point at the mouse, the gun is 0.1 closer to the camera, at certain angles the gun renders BEHIND the player. How do I fix this? In orthographic it works, but I want the parallax effect. What can I do?

EDIT: Some of these errors are occurring within the backgrounds as big as 2.9 units back.

Is it possible to fix this with shaders? Change the order the game culls based on a variable I choose?

Use this to change your sprite sorting to orthographic:
http://docs.unity3d.com/Documentation/ScriptReference/Camera-transparencySortMode.html

Beautiful, 1-line fix. Thanks.