A. When she comes running to you in tears because her friend has dissed her, offer her comfort, telling her you understand why she's sad and that it's not right for her playmate to treat her that way. Then try to redirect her toward another child. If the friend comes back with a better attitude, encourage your daughter to give her another chance.
When your child starts to copy her pal's bad behavior, remind her in a voice that her friend can also hear that "we don't treat people like that in our family." Even at age 5, she can instinctively understand the concept of taking the higher road, that stooping to the same behavior to get back at someone doesn't make you feel good about yourself. Teach her to say, "I don't like it when you talk to me that way," and rehearse it with her before you head to the playground so she'll be ready.
Try to avoid reprimanding Miss Sassy -- it may just drag you into a confrontation with her parent that won't solve anything. But parenting etiquette does allow you a "Don't talk to me that way" if the child says or does something nasty directly to you.
Your daughter's fascination with this child will fade in time if they're not kindred spirits, and it sounds as if they're not. In the meantime, you could bring a different friend next time or find another playground.