Was she correctly potty trained at any point (with no accidents)?
This sounds like a psychological problem. It sounds as if something possibly traumatic happened to her and she is reverting.
If this is NOT the case, I highly disagree with a poster who said not the "shame" your child. At 5 years old the child is old enough, and a bit of humiliation (and not in a severe way) can be a very useful tool. Making her wear pull ups or taking away "big girl" clothes (like pretty dresses or costumes) may be the correct amount of shame to snap her back to attention. If you tell her that she can only have these things (panties, pretty dresses, special toys etc) if she behaves like a big girl and uses the potty like a big girl, she'll understand how her actions are negatively affecting her. She'll be shamed, to be sure, but for most children it's the right amount to make a connection between negative behavior and negative consequences, without seriously upsetting them.
However, as I said above, if this is psychological in nature, and not just her losing her focus, then any form of shame is definitely not the way to go, as it will only compound the problem and force her deeper into her shell.
It may also be beneficial to find a local play place that requires her to be potty trained. We used this with our 3 year old daughter, who just REFUSED to use the potty. 3 weeks ago, we took her and her older sister to IKEA, which has a little kid's place. She couldn't go in because she was still in pull ups. After a bit of a tantrum when her sister could go in and she couldn't, she pulled out a steely determination most adults would be envious of. We told her if she could go 1 week wearing panties and using the potty with zero accidents during the day, we'd take her back.
Well, we got home, she took off her pull up, tossed it, put on a pair of panties and hasn't had an accident since.