There will certainly be more to say, not least about varieties of espionage in Europe, but we probably need to start by pointing out that the idea that there were such groups as "ninjas" in early modern Japan has been strongly challenged in recent years, and most historians of the time and place tend to conclude that they did not in fact exist. While you're waiting for further answers to your question, you might like to review this earlier thread, led by u/NientedeNada, which links to several additional discussions concerning the debate over the ninjas.