We study the magnetic-field dependence of the interactions between two alkaline-earth(-like) Rydberg atoms, Sr and Yb. Considering the pair of Rydberg states and , we show that the effective Hamiltonian takes the form of an {\it XXZ}-type quantum spin model, as in the alkali-atom case [M. Kunimi and T. Tomita, Phys. Rev. A {\bf 112}, L051301 (2025)]. We find that the behavior of the anisotropy parameter for Yb at z
