Was she fully potty trained before? no accidents? Has she been exposed to any new people in her life? Have situations drastically changed? Is she jealous of the baby? Was she angry at you or someone else right before wetting her pants?
You really need to take the time and sit down with her, ask questions and listen to the responses. Find out how she feels about the baby, staying with your family, and the situation with her mom and her grandmother.
You should have the good touch bad touch talk, and you need to make sure you talk often. Ask questions.
I can see when my girl needs to go to the bathroom, she squirms and wiggles while she is playing. I remind her and she'll shoot off like a rocket to the bathroom sometimes.
Make sure that you try to give her as much attention and affection as you can. Try to make her feel like she belongs to your family and that you are happy to have her with you.