Good and fair question.
I think this should be approached similar to a situation in which a boy punched another boy in the face. That would be violence that should be punished.
But if the attacked boy had miss-sexed his attacker, saying something like, "Look at you, little girl! Is it time for your period, cutie pie? Is that why you look so mad? Ooh, are you going to hit me with your purse, or scratch out my WHAM . . . (hits floor)."
The violence would not be justified, but it there are mitigating circumstances.