S.P.
Y'know . . . it may not be a "behavior" problem.
It may be a physical problem.
I'm glad you're being proactive and supportive.
Since she's old enough to have a real conversation,
maybe sit down and discuss the situation with her.
Let her know that she's not naughty.
Maybe she just needs help with this.
Discuss the options . . .
pull-ups at night?
Reminders about pooping?
etc.
Let her be part of the problem-solving process.