I have several Raspberry Pi 4 with a case that includes a fan. I connected the red cable to 5v Power(Physical/Board pin 4) and the black cable to GPIO 14 (Physical/Board pin 8). I setup raspi-config to turn on fan at 60 and use GPIO 14. When the temperature goes higher than 60 degrees, I notice the GPIO gets triggered, but the FAN doesn't spin. If I connect power and ground the fan spins. I would really prefer to make a config change and have to unmount and take apart 8 Raspberry Pi.
I endorse joan's comments.
It is simple to control a fan with inexpensive circuit. See https://raspberrypi.stackexchange.com/a/105820/8697
See https://docs.google.com/document/d/1bxIzUXLXdrtTo7DwAYv8maLeBssYau4nWwyeAAjot-0 for a picture of my module.
You should NEVER connect a GPIO to an inductive load. Eventually you will destroy the GPIO and the Pi.
You should NEVER connect a GPIO to a voltage outside the range 0 to 3.3 volts. Eventually you will destroy the GPIO and the Pi.
A GPIO can only supply (source or sink) about 20 milliamps at 3.3 volts. Nowhere near enough to power a motor even if it was safe to do so.