The prevalence of micropores and nanopores in low-permeability reservoirs is a cause for concern, as it results in a sizeable quantity of oil reserves being trapped within them. The water-gas dispersion system has the capacity to expand the reservoirs’ wave volume and enhance oil recovery. While the microscopic oil repulsion mechanism has been the center of attention, the oil repulsion effect of three distinct types of gases (N2, CH4, and CO2) is of particular importance in understanding the displacement mechanism of N2/CH4/CO2 on heptane at the blind end of the nanometer. A molecular dynamics simulation using the LAMMPS software was employed to construct a model of a blind end of heptane on a SiO2 wall and an interface model with different types of gas molecules. This was done to investigate the microscopic mechanism of heptane replacement by gas molecules. The temperature (50 °C) and pressure (30 MPa) of the reservoir in the Changqing oil field are selected as the parameters for analysis. The findings indicate that all three types of gas molecules can enter the blind end and displace heptane. However, supercritical CO2 forms a mixed phase with heptane, which is more prone to extruding oil molecules situated near the inner wall surface of the blind end and desorbing the oil film. The results demonstrate that, in the context of the blind end, gaseous CO2 exhibits a lower solvation ability but superior extrusion diffusion ability for heptane compared to N2 and CH4. Furthermore, the interaction energy indicates that the interactions between two states of CO2 and heptane, as well as the thickness of the interface, increase with increasing pressure and temperature. The findings of this study elucidate the microscopic mechanism underlying the replacement of oil droplets or oil films at the blind end by different gases under reservoir conditions at the molecular level and offer further guidance for the selection of the gas phase and the replacement state in the water-gas dispersive drive system.