Recent long-wavelength observations on the thermal dust continuum suggest that the Rayleigh–Jeans tail can be used as a time-efficient quantitative probe of the dust and interstellar medium (ISM) mass in high-z galaxies. We use high-resolution cosmological simulations from the Feedback in Realistic Environment (FIRE) project to analyse the dust emission of M* ≳ 1010 M⊙ galaxies at z= 2–4. Our simulations (MassiveFIRE) explicitly include various forms of stellar feedback, and they produce the stellar masses and star formation rates of high-z galaxies in agreement with observations. Using radiative transfer modelling, we show that sub-millimetre (sub-mm) luminosity and molecular ISM mass are tightly correlated and that the overall normalization is in quantitative agreement with observations. Notably, sub-mm luminosity traces molecular ISM mass even during starburst episodes as dust mass and mass-weighted temperature evolve only moderately between z = 4 and z = 2, including during starbursts. Our finding supports the empirical approach of using broadband sub-mm flux as a proxy for molecular gas content in high-z galaxies. We thus expect single-band sub-mm observations with ALMA to dramatically increase the sample size of high-z galaxies with reliable ISM masses in the near future.