Far-infrared line emission from high-redshift galaxies