Pirates had guns but these guns were more likely to misfire or just miss than actually hit anything. Pirates arent slow like you would think ninja's became highly exaggerated in the media because they were from the "mysterious" east.
Assuming they start off being able to see each other on land in an open field, the pirate has a small chance of hitting the ninja with his gun but most likely not the ninja will throw shurikins or darts back which again may or may not hit. If no one is mortally wounded or dead by then they will close to hand to hand combat the pirate with a sword and the ninja with well im not sure they would have a lot of weapons to pick from. Anyway assuming this happened id say the ninja would win if for nothing else their ablities in martial arts.