Caveman has it right. It's especially interesting to note that since gravitational potential energy is negative for objects a finite distance apart, if you measure the mass of the Moon and the Earth separately (take each one far away from any other masses temporarily, so as to avoid any influence), the mass of the huge black box containing them both will be slightly less than the total, just like the mass of a bound hydrogen atom is a very tiny bit less (13.6 eV) than a proton and an electron separately. Working it out, it's a bigger number than you'd think. The binding energy of the Earth-Moon system is about -8.3 x 1011 kilograms equivalent. Of course, we offset half of that loss with the kinetic energy of the Earth-Moon system, which has a positive value, and would also be counted in the mass of our black box. That represents about one part in 10 trillion of the total mass of the system, which I'm pretty sure is well below the accuracy with which we can measure the mass of things like planets. For the hydrogen atom, the binding energy is on the order of one part in 100 million of the total mass of the system.
Edit to add: Just out of curiosity, I went over to Wikpedia's Orders of magnitude (mass) page to see if there was a good comparison for that amount of mass. It turns out that right at 4 x 1011 kilograms is the total mass of all the people on Earth. I thought that was an amusing coincidence.
Conserve energy. Commute with the Hamiltonian.