Is it possible to get to her in the middle of the night to let her out. At this age she is still to young to hold it for more than 4 hours at a time. As she gets older it will get better. The rule of thumb for how long a puppy can hold it is age +1. For example a dog who is 5 months old can hold it 6 hours. This is just a rule of thumb. You will need to learn your own puppies ability.

You are right in not punishing her. If you don't catch her in the act she will not associate why she is getting punished with why you are mad. Whatever she is doing at the moment you correct her is what she will associate to the correction.