K.H.
First I would say that if the discipline that you or her mother are giving this particular misbehaving girl is not working, then both of you are probably needing to seek out something different. For example, if you are at the park, and she starts to hit or be mean...maybe her mother taking her home for the rest of park time... completely removing her from the fun unless she learns to treat others nice. If she is at your house, and starts to hit your daughter...try having her mom take that daughter home. If you and the mom are close enough friends, that she wouldn't mind doing that, and leaving the other daughter with you to still enjoy playing, that might really get to the girl that is misbehaving. You (or really her mother) needs to experiment with what discipline is going to inspire her to actual behave appropriately.
I too have been in your position. My daughter is now 5, and her friend that is a nearby neighbor, that attends her kindergarten class, and that her mom and I are friends.. is similar. Her daughter is in the process of being diagnosed with ADD, and she frequently throws fits, screams, and doesn't treat her mother in the same way that I expect my girls to treat me. At times, my 5 year old will start to follow a few things things girl does, but I try to end it immediately, and make clear to her that her friend has trouble controlling herself, and the way she behaves in NOT appropriate, and that she should not copy what she does..that she knows better, and can control herself, therefore, I expect that from her. Even though ADD may have nothing to do with your case, just fill it in similarly in that she hasn't learned to control herself, or to treat others nice, but that your daughters does. I did mention this to my daughter prior to seeing any of the behavor coming out in my daughter, and I do think that gave my own a heads up, and helped her understand what is going on. Maybe just have a talk with your daughter, she should be able to understand this at 4. Good luck!
K.