On the Connection Between the Gamma-ray and (Sub-)mm Emission in Active Galactic Nuclei