The search for new global scaling relations linking the physical properties of galaxies has a fundamental interest. Furthermore, their recovery from spatially resolved relations has been in the spotlight of integral field spectroscopy (IFS). In this study, we investigate the existence of global and local relations between stellar age (Age⋆) and gas-phase metallicity (Zg). To this aim, we analyze IFS data for a sample of 736 star-forming disk galaxies from the MaNGA survey. We report a positive correlation between the global Zg and D(4000) (an indicator of stellar age), with a slope that decreases with increasing galaxy mass. Locally, a similar trend is found when analyzing the Zg and D(4000) of the star-forming regions, as well as the residuals resulting from removing the radial gradients of both parameters. The local laws have systematically smaller slopes than the global one. We ascribe this difference to random errors that cause the true slope of the Age⋆-Zg relation to be systematically underestimated when performing a least-squares fitting. The explored relation is intimately linked with the already known relation between gas metallicity and star formation rate at fixed mass, both presenting a common physical origin.