Flipping sprite when above/below certain z rotation

I was trying to make an object flip their sprite based on the rotation of another object, but the detection for rotation doesnt seem to work. No matter how much i change the code it always either only activates when its from 0-90 in z rotation or just doesnt activate at all. I want it to flip based on which side it is of the object.

void flip()
{
    if(otherObject.transform.rotation.eulerAngles.z > 90 && otherObject.transform.rotation.eulerAngles.z < -90)
    {
        Renderer.flipY = false;
    }
    else
    {
        Renderer.flipY = true;
    }
}