A superlattice composed of spin-1 and spin-2 with ABAB… structure was described with Heisenberg model. The magnetizations and magnetic entropy changes under different magnetic fields were calculated by the Green's function method. The magnetization compensation phenomenon could be observed by altering the intralayer exchange interactions and the single-ion anisotropies of spins. Along with the temperature increasing, the system in the absence of magnetization compensation shows normal magnetic entropy change and displays a peak near the critical temperature, and yet the system with magnetization compensation shows normal magnetic entropy change near the compensation temperature but inverse magnetic entropy change near the critical temperature. Finally, we illustrated the reasons of different behaviors of magnetic entropy change by analyzing the contributions of two sublattices to the total magnetic entropy change.