I'm sorry you feel at your wit's end. It is hard to see a child go through that and not know what to do. Five years is a long time. For your daughter that's more than 50% of her life, so it must seem never ending to her too.
I think that it's normal for it to be difficult if that helps ( so it's not that there is something wrong with your daughter- she is reacting in a normal way to a difficult situation she finds herself in, in a similar way to a lot of children who find themselves in that situation), and to be more difficult in tween and teen years than with very young children. As they start to develop more of a sense of self, a better sense of right and wrong (and how perhaps some of the adults in their lives aren't practising what they preach) and a more developed awareness of the undercurrents going on around them, then it adds layers of confusion that aren't really there for a 5 year old.
My mother stopped me seeing my dad when I was around 8, due to his increasingly unreasonable behaviour, the unreasonable behaviour of his new partner and the effect it was having on me. The unreasonable behaviour was corroborated by a social worker who was asked to assess/mediate the situation by the way. I understand why she felt the need to do that, but I don't think it was the right thing either.
If you don't mind my saying, it might help to acknowledge that she has some legitimate anger and distress about the situation. It's not her fault- her anger and distress is a normal reaction to the things that are happening to her. She needs not to repress the anger but have a safe and healthy outlet for expressing it and learning to handle it/come to terms with the situation. From my experience as a child, it might be that she would struggle to speak to you about it wholeheartedly.
That's not because she doesn't trust you, but because she senses that you are emotionally invested in the situation too and she doesn't want to hurt you or make you angry with something she says. That's because she loves you and she doesn't want to damage your relationship, so she represses her feelings and it comes out in ways that are "bad behaviour". She will already feel vulnerable because of the situation with her father and what he has been saying, and it will be confusing for her.
She maybe needs someone neutral to talk to to express herself, whether that's a counsellor, or relative who is a bit more removed from the situation of an online support group.
I think it would be realistic to acknowledge that over the next few years it is probably going to get even harder for her, and to take some action now to help her with it. There isn't a magic wand here. Even without there being one parent saying bad things about the other, or any extra tensions, don't underestimate how difficult it is to never have all the people you love in one room at a time, getting on. A lot of people take that for granted and expect it, and it's something a child of parent's who are no longer together rarely has, even when they are often under pressure to be part of two families where everyone else regularly experiences that. No matter how happy they are, or surrounded by love, they are always missing someone special. That is a difficult emotional state for a child to articulate and express, never mind handle.
There is a good book called "the Unexpected Legacy of Divorce" that follows the lives of some children over 25 years after their parents split. It does show some common and normal patterns- children feel anger, confusion and hurt over the situation. I don't think there is a way to avoid that. And in a funny way, the anger can help them cope and heal, as long as it isn't misdirected. It's a bit like getting angry during a grieving process- if you try to skip that bit you just get stuck there.
I think there are ways to minimise the anger and so on and the disruption caused by it, make the best of it and help children handle it, but I think those feelings are going to happen regardless. It might help to read that book, as a lot of the children explain, as adults, how they felt as children, but couldn't really express properly at the time. It definitely helped me to read it when I was in my mid 30s.
But it also shows that children also are very good at working out whether each parent has their best interests at heart by the time they are a young adult, and this shapes the relationship they have with each parent for the rest of their lives. e.g. one parent treats the child well and treats the other parent well, everything will be fine with that parent, other parent treats either the child or the other parent badly, it's likely not to be fine with that parent in the long run, both parents do their best, then the child will have a good relationship with them. they aren't stupid and they do see who has behaved well in the situation and trust those that do. It doesn't mean that a parent has to behave perfectly, just be well intentioned and trying their best.
Hope that helps, and wish I had a magic wand, just like I wish had had a magic wand for my mum 30 years ago.