z rotation changes for no reason

Hello. I have a minigun which stays on it´s position and i want to rotate it on the x and y axis but somehow the z axis changes aswell. Im trying to solve it for 3 hours now.

void Update()
    {
        //Shoot if mouse pressed
        if(Input.GetButton("Fire1")){
          if(currentAmmo>0f){
            Shoot();
            }
        }

       float mouseX = Input.GetAxis("Mouse X") * sensi * Time.deltaTime;
       float mouseY = Input.GetAxis("Mouse Y") * sensi * Time.deltaTime;

       transform.Rotate(new Vector3(0,1,0)*mouseX);
       transform.Rotate(new Vector3(1,0,0)*(mouseY*-1));
    }

I am grateful for every Help :).

Did this and it finally worked:

       float mouseX = Input.GetAxis("Mouse X") * sensi * Time.deltaTime;
       float mouseY = Input.GetAxis("Mouse Y") * sensi * Time.deltaTime;

       xRotation -= mouseY;
       yRotation += mouseX;

       transform.rotation = Quaternion.Euler(xRotation,yRotation,0);

Why have you applied transform.Rotate twice?

Doe mouse value return ± 0.0 - 1.0?

            transform.Rotate (360 * mouseX, 360 * mouseY, 0);

Really should not multiply mouse axis by deltaTime either.

This is a natural mathematical consequence of rotating in 2 axes. During my brief stint making Youtube videos while unemployed, I made a video about exactly this issue.