ABSTRACT The Atacama Large Millimeter/Submillimeter Array (ALMA) in the submillimetre and the JWST in the infrared have achieved robust spectroscopic detections of emission lines from the interstellar medium (ISM) in some of the first galaxies. These unprecedented measurements provide valuable information regarding the ISM properties, stellar populations, galaxy morphologies, and kinematics in these high-redshift galaxies and, in principle, offer powerful tests of state of the art galaxy formation models, as implemented in hydrodynamical simulations. To facilitate direct comparisons between simulations and observations, we develop a fast post-processing pipeline to predict line emission from the H ii regions around simulated star particles, accounting for spatial variations in the surrounding gas density, metallicity, and incident radiation spectrum. Our ISM line emission model currently captures H α, H β, and all of the [O iii] and [O ii] lines targeted by ALMA and JWST at z > 6. We illustrate the power of this approach by applying our line emission model to the publicly available Feedback In Realistic Environments (FIRE) high-z simulation suite and perform a detailed comparison with current observations. We show that the FIRE mass–metallicity relation is in 1σ agreement with ALMA/JWST measurements after accounting for the inhomogeneities in the ISM properties. We also quantitatively validate the description of the one-zone model, which is widely used for interpreting [O iii] and H β line luminosity measurements. This model is publicly available and can be implemented on top of a broad range of galaxy formation simulations for comparison with JWST and ALMA measurements.