Which Layer (or Camera) is the Mouse clicking on

So I have the main camera driving the main screen, and then a second camera with an inset view. I have each camera’s culling mask set to separate layers.

I would like to rotate CameraX if the person is holding down the button and moving the mouse back and forth over that layer (X). But if the person is holding down the button and moving the mouse over the inset layer (Y), then I want to rotate CameraY.

void Update() {
if (Input.GetMouseButton(0))
{
if[mouse clicked on layer X] {
cameraX.transform.eulerAngles += new Vector3(0, Input.GetAxis(“Mouse X”) * orbitingSpeed * Time.deltaTime, 0);
} else if [mouse clicked on layer Y] {
cameraY.transform.eulerAngles += new Vector3(0, Input.GetAxis(“Mouse X”) * orbitingSpeed * Time.deltaTime, 0);
}
}
}

** Sorry I don’t know how to properly format code in this forum yet.

There must be an easy way to do this, but I don’t know where to start or what to Google for.

After more Googling, I finally stumbled on a post from 2010 that had the hint:

camera.pixelRect.Contains(Input.mousePosition);

If one screen is overlaying another, there is more housekeeping to do, but this is the key piece of the puzzle that was missing in my wee brain.