A quantitative relation between the intensities of cosmic γ-rays with energies near 1014 eV and X-rays generated by synchrotron emission of cosmic electrons is derived on the basis of the fact that these two radiations have a common energy source in the interactions between cosmic-ray nuclei and interstellar matter. The relation depends on the intensity of the magnetic field in the region of production. Quantitative estimates based on recent data indicate that synchrotron X-rays may constitute a significant component of cosmic X-rays below 3 a at high galactic latitudes. It may therefore be possible to obtain a new measurement of the interstellar magnetic field by a comparison of the intensities of cosmic X-rays and ultra-high-energy cosmic γ-rays.