I had a similar issue with one of the rear windows on our X3 - turned out the 'squeal' was coming from the part of the guide channel that you can't see i.e. the part inside the door.
As the Z4 windows are frameless, if your windows are still making the sound with the door open, I'd suspect a similar issue with the lower guides
To avoid having to remove the door card & membrane, I cured it by the application of silicone grease into the upper guides (with the window down), then ran the window up/down a few times to carry the grease into the lower channel - repeated the process a couple of times and the squeal reduced and then disappeared. Then gave the glass a good clean to remove any grease that had spread from the guides onto the surface.