The rapid growth in energy consumption and environmental pollution have greatly stimulated the exploration and utilization of shale gas. The injection of gases such as CO2, N2, and their mixture is currently regarded as one of the most effective ways to enhance gas recovery from shale reservoirs. In this study, molecular simulations were conducted on a kaolinite–kerogen IID composite shale matrix to explore the displacement characteristics of CH4 using different injection gases, including CO2, N2, and their mixture. The results show that when the injection pressure was lower than 10 MPa, increasing the injection pressure improved the displacement capacity of CH4 by CO2. Correspondingly, an increase of formation temperature also increased the displacement efficiency of CH4, but an increase of pore size slightly increased this displacement efficiency. Moreover, it was found that when the proportion of CO2 and N2 was 1:1, the displacement efficiency of CH4 was the highest, which proved that the simultaneous injection of CO2 and N2 had a synergistic effect on shale gas production. The results of this paper will provide guidance and reference for the displacement exploitation of shale gas by injection gases.