Thank you all. It turned out that there is nothing wrong with z buffer in mac.
The problem was that polygonOffset was behaving differently in mac os x.
In my project when you draw a wall, some annotation lines are drawn on it. These lines flicker or hide under the wall polygon so I was forced to use PolygonOffset. Unfortunately in OpenGL PolygonOffset doesn't have any effect on lines (am I correct?) so I had to offset the wall mesh. But doing that caused Mac OS X to render the back mesh in front.
So now I went through every single mesh in my scene and offset all of them except the lines. Is this the way to go? or was there an easier way?