For epitaxial trilayers of the magnetic rare-earth metals Gd and Tb, exchange coupled through a nonmagnetic Y spacer layer, element-specific hysteresis loops were recorded by the x-ray magneto-optical Kerr effect at the rare-earth M5 thresholds. This allowed us to quantitatively determine the strength of interlayer exchange coupling (IEC). In addition to the expected oscillatory behavior as a function of spacer-layer thickness dY, a temperature-induced sign reversal of IEC was observed for constant dY, arising from magnetization-dependent electron reflectivities at the magnetic interfaces.