Gas-phase metallicity of 27 galaxies at intermediate redshift