Answer:
There are two caps in Dire Dire Docks in Super Mario 64. You can find them by going through the underwater tunnel in the first part. It is located to your left when you first come in. After you've gone through the tunnel, head to the surface, and look for the left end of the platform.
(Note: you can get both caps at once. Simply get the invisibility cap, and then get the metal cap)