Mine went through a stage like this (shut overnight in open plan living/ dining room with a baby-gate) and I spent what seemed to be forever cleaning up accidents and in his bed.
I'll start with a few options form you to try and am sure others will suggest more too:
1) Ensure the puppy is REALLY praised when it goes to the toilet outside. Take it out as an event - use a command so it knows what you expect it to do, then praise, praise, fuss and more praise. Toys, treats, back rubs.
2) Make sure the very last thing you do at night is take it out for the toilet. Praise again then make sure it's nice and calm and settled before you leave it - make sure it knows it is not allowed in the other dog's bed.
3) If you come down in the am and it has made a mess - IGNORE the dog, No fuss, no eye contact, no nothing - (no shouting - that is still attention) - let it straight out and big fusses for going outside. I know this is hard to do especially when you are angry and up to ears is P and Poop.
4) Cage - Never tried it, but is recommended by some dog trainers - apparently works for toilet training but I don't have any experience of them.
5) If it is no 2's that are the issue - feed dinner as early as possible in the evening, so they can get sorted before sleep time - check the food isn't giving them the runs and they can't physically keep it in until morning.
6) Buy a lavender plug in air freshener - scent that will calm the puppy at night, in case the piddling is nerves.
7) Separate the older dog and pup at night- they might be playing during the wee hours and bringing on the need to toilet for the pup.
Hope this helps and I haven't been teaching you to suck eggs? x