I don't think this warrants punishment. I actually think this is a common thing with the under 6 set. I doubt your DD is purposefully doing this, and she likely just needs to increase her self awareness about her bodies needs. Kids sometimes get so wrapped up in playing, or whatever else they are doing, that I don't think they think about taking a break for the potty. Then when they realize they need to go, they REALLY need to go, like yesterday!
I have a funny story to tell relating to this topic. Just last week we were on vacation, and I was lounging around by the resort pool, half reading and half watching these two funny little boys playing in the pool who had just met and became fast friends. They were about 4. All of a sudden, one of the boys stops his playing and yells to his mom that he has to go to the bathroom bad, so she encourages him to get out of the pool quick and run to the bathroom. He hops out of the pool, runs to the entrance of the building that houses the restrooms and stands in the doorway and yells to his mom again that he has to pee...BAD! Again, she tells him to get himself to the bathroom. He looks over at the pool and says in a resigned sort of way "oh, I already did", and then he flew himself back into the pool.

His mom never heard him, but the lady in the lounge chair next to me did and we bust a gut laughing and agreed that we remembered those days.
Those days will pass, believe me. In the meantime, I would suggest asking your DD directly if she can maybe come up with a little list of things she can try that she can do to help the situation. It is her issue, so involving her in the solution might be good. A reward system for her initiating potty time without an accident, as suggested by karinbelle, is something worth a try too, especially since her accidents are a few times per week at this point.