We present Very Large Telescope/X-shooter spectra of 13 galaxies in the redshift range 1 ≲ z ≲ 6, which are strongly lensed by massive galaxy clusters. Spectroscopic redshifts are measured for nine galaxies, while three sources have redshifts determined from continuum breaks in their spectra. The stellar masses of the galaxies span four orders of magnitude between 107 and 1011 M⊙ and have luminosities at 1500 Å rest frame between 0.004 and 9L* after correcting for the magnification. This allows us to probe a variety of galaxy types from young, low-mass starburst galaxies to massive evolved galaxies. The lensed galaxies with stellar masses less than 1010 M⊙ have a large scatter compared to the fundamental relation between stellar mass, star formation rates and oxygen abundances. We provide a modified fit to the fundamental relation for low-mass, low-metallicity galaxies with a weaker dependence of the metallicity on either the star formation rate or stellar mass compared to low-redshift, high-mass and high-metallicity Sloan Digital Sky Survey galaxies.