The nuclear recoil effect on the $g$ factor of Li-like ions is evaluated. The one-electron recoil contribution is treated within the framework of the rigorous QED approach to first order in the electron-to-nucleus mass ratio $m/M$ and to all orders in the parameter $alpha Z$. These calculations are performed in a range $Z=3-92$. The two-electron recoil term is calculated for low- and middle-$Z$ ions within the Breit approximation using a four-component approach. The results for the two-electron recoil part obtained in the paper strongly disagree with the previous calculations performed using an effective two-component Hamiltonian. The obtained value for the recoil effect is used to calculate the isotope shift of the $g$ factor of Li-like $^{A}$Ca$^{17+}$ with $A=40$ and $A=48$ which was recently measured. It is found that the new theoretical value for the isotope shift is closer to the experimental one than the previously obtained value.