Observational studies have revealed that galaxy pairs tend to have lower gas-phase metallicity than isolated galaxies. This metallicity deficiency can be caused by inflows of low-metallicity gas due to the tidal forces and gravitational torques associated with galaxy mergers, diluting the metal content of the central region. In this work we demonstrate that such metallicity dilution occurs in state-of-the-art cosmological simulations of galaxy formation. We find that the dilution is typically 0.1 dex for major mergers, and is noticeable at projected separations smaller than $40$ kpc. For minor mergers the metallicity dilution is still present, even though the amplitude is significantly smaller. Consistent with previous analysis of observed galaxies we find that mergers are outliers from the emph{fundamental metallicity relation}, with deviations being larger than expected for a Gaussian distribution of residuals. Our large sample of mergers within full cosmological simulations also makes it possible to estimate how the star formation rate enhancement and gas consumption timescale behave as a function of the merger mass ratio. We confirm that strong starbursts are likely to occur in major mergers, but they can also arise in minor mergers if more than two galaxies are participating in the interaction, a scenario that has largely been ignored in previous work based on idealised isolated merger simulations.