dried sandwich spread sealer?

when I took the fenders off my 68 Barracuda, I found a dried later of what looked like tannish colored dried sandwich spread along the edges of the engine bay where the fenders bolt to this section. Was this supposed to be a cushion between the fender and the engine bay? I sanded and ground it off and found rust under it. Before I paint the engine bay and put the fenders back on, do I need to put down some sort of insulation material between the two metal surfaces and what would you all suggest? Thanks.