I found this solution
Z1 = peaks;
Z2 = peaks.^2;
ax = subplot(2,1,1);
hold on
contourf(Z1,'--')
colorLim = ax.CLim;
contour(Z2,'-k')
ax.CLim = colorLim;
colorbar
axis equal
First, we saved the color limits CLim. Then, we plot the second contour plot and set the CLim from the previous one.