Be sure to place a bit of cardboard/rubber mat etc around cap where you need swing the hammer to try to protect paint work.
Btw, if you are to re-furb the cap, be sure to not just replace gasket. Remove the spring supported plate to swap out original, likely brittle/crumbly bit of rubber hose with modern ethanol resistance hose. It is this hose that provides the sealing force against the tank neck, not the metal spring. Some caps have a rivet holding the plate, need to be drilled out then run a tap through and use a machine screw (or re-rivet).