Z Axis look at another object direction

Hi I have two objects, one in the middle and one is far little bit
I want the one that is far to be looking at the one in the middle by Z Axis

Solved by me:

Vector3 direction = target.position - transform.position;
Quaternion rotation = Quaternion.lookRotation(direction);
transform.rotation = rotation;