Both of my cars are brand new and rattle free, so I have never tried it, but I recently heard that double sided tape is the magic cure.
Isolating where the rattle is coming from can be very difficult, but once you do try to get a small piece of tape between the panels. If you cannot get it in...