We have studied Ir spin and orbital magnetic moments in the double perovskites La$_{2-x}$Sr$_x$CoIrO$_6$ by x-ray magnetic circular dichroism. In La$_2$CoIrO$_6$, Ir$^{4+}$ couples antiferromagnetically to the weak ferromagnetic moment of the canted Co$^{2+}$ sublattice and shows an unusually large negative total magnetic moment (-0.38,$mu_{text B}$/f.u.) combined with strong spin-orbit interaction. In contrast, in Sr$_2$CoIrO$_6$, Ir$^{5+}$ has a paramagnetic moment with almost no orbital contribution. A simple kinetic-energy-driven mechanism including spin-orbit coupling explains why Ir is susceptible to the induction of substantial magnetic moments in the double perovskite structure.