You can define TIP5P molecules with a molecule file and then populate your simulation box with them using create_atoms. You can then simulate the water molecules as rigid objects using fix rigid or fix rigid/small (or their thermostatted/barostatted variants). To avoid LAMMPS erroring out, you need to assign a tiny mass to the “massless” sites, but if those masses are small enough, they won’t make a difference (thanks to the truncation of floating point math).
TIP4P is a special case, since one can use the same neighbor list entry for both the oxygen atom and the massless charge point M and thus gain a significant speed advantage. For TIP5P something similar could be done, but it would be a significant amount of coding. TIP4P has the big benefit that it is flat, which simplifies the vector algebra significantly.