The teacher must intervene. An effective teacher will help both children:
1. The teacher must tell the boy that he must respect other children, and not call them names they don't like. She must see to it that he follows through. In fact, this must be a cultural norm at the school: respecting other's physical and mental space. It needs to be repeated over and over again, and practiced over and over again. Because they're four.
2. The teacher must help the child articulate a response when the boy says this to her. Whatever is appropriate for that age. Like, "You know I don't like that, and you're being disrespectful." (Yes, kids can talk like this). The teacher really should have a good idea for how to help your child stick up for herself, but also to show her how to let certain things roll off her back. There is a time for both. However, she should not be expected to let all things roll off her back, and to be sure, being called something she doesn't like is one of those things she shouldn't have to put up with.
The teacher. Talk with the teacher. If she's a good one, she'll have a clear idea of what to do, so that both children learn how to be good citizens in the classroom and in the world.
It's important.
