pwm amplifier with npn bjt
You will need to investigate the fan PWM input requirements. Most times they will need a bias to activate the input. If your fans are like this then you may need to add a pullup resistor from the NPN transistor collector to +5V.

The bias source for the fan PWM inputs for all the various fans that I've designed into server platforms use an open drain driver (equivalent to your transistor circuit) and a 5.1K ohm pullup resistor to +5V. There is no problem having the pullup to a +5V source despite the fact that the fan runs off +12V. The only requirement is that the PWM driver GND and the fan GND need to be one and the same. 

You could derive the bias source from the fan +12V using a voltage divider but do know that the input impedance of different fans varies and the optimum voltage divider for one type of fan may not be ideal for another type of fan. This can be somewhat mitigated by making the resistors in the divider suitably small in value but then you would be consuming excess current from the 12V supply when the fan drive signal goes low.