I'm sorry you're having to deal with this. My DD has had this happen, and I've seen it in other contexts also (music, sports, etc).
I told DD that bragging is usually a sign of insecurity - if the kid really needs that much external validation, he must be insecure. Assure your DD that she is just as capable as this kid, and that any other day of the week, the tables may be turned.
The teacher doesn't necessarily have to talk to this kid in person (or his parents), although she should IMHO. Maybe she could make a general statement to the class in the next few days - something like, "We are all valuable members of the class, and we don't mock or ridicule each other for wrong answers - that's how we learn."
Learning is not a linear process -it's often exponential, especially in GT kids. I've seen DD and DS leap beyond kids who previously were bragging about their own accomplishments.