I would use seam sealer before that foam. You know it's not going to cause rust and if the parts are close enough to rattle, the sealer will stabilize them.