UI image to point to 3D object

I’d like a UI image of an arrow to point towards a 3D game object in my scene (the exit), but for it to remain in 2D. I use the LookAt function, but this rotates my UI element in 3D, which isn’t useful as it then can’t easily be seen.

transform.LookAt(target.transform);

Is there a way I can restrict the image’s rotation so it only rotates in the Z axis?

var targetPosLocal = Camera.transform.InverseTransformPoint(targetObjectPosition);
var targetAngle = -Mathf.Atan2(targetPosLocal.x, targetPosLocal.y) * Mathf.Rad2Deg - 90;
ArrowUIObject.eulerAngles = new Vector3(0, 0, targetAngle);