The ninjutsu ability can be activated when a creature attacks and isn't blocked.
From the glossary of the Comprehensive Rules (Ravnica Allegiance (January 25, 2019))
- Attacks and Isn't Blocked
- An ability that triggers when a creature "attacks and isn't blocked" triggers when the creature becomes an unblocked attacking creature. See rule 509.1h.