Driving NPN with Raspberry Pi
It would be best if you provided current limiting for the GPIO port. It depends on the current gain of the NPN transistor, but at minimum a 200Ω series resistor from the GPIO to the NPN needs to be used to limit the current to less than 16mA. (and also use less than a total limit of 50mA on all ports)