Scanning tunneling microscope induced light emission from an atomic or molecular junction has been probed from the tunneling to contact regime in recent experiments. There, the measured light emission yields suggest a strong correlation with the high-frequency current/charge fluctuations. We show that this is consistent with the established theory in the tunneling regime, by writing the finite-frequency shot noise as a sum of inelastic transitions between different electronic states. Based on this, we develop a practical scheme to perform calculations on realistic structures using nonequilibrium Green's functions. The photon emission yields obtained reproduce the essential feature of the experiments.