Because gas injection into geological formations is a common technology deployed for enhanced oil recovery (EOR), it is important to understand at the molecular level the relations between competitive adsorption and fluid mobility at the single-pore level. To achieve such an understanding, we report here molecular dynamics simulation results to document structural and dynamical properties of n-octane confined in slit-shaped alumina and graphite pores in the presence of CO₂ and H₂S. The substrates are chosen as proxy models for natural hydrophilic and hydrophobic substrates, respectively. It was found that CO₂ and H₂S could displace n-octane from alumina but not from graphite surfaces. Analysis of the results demonstrates that more attractive n-octane – surface and weaker CO₂/H₂S - surface interactions in graphite compared to alumina are responsible for this observation. Regardless of pore type, the results suggest that adding CO₂ or H₂S suppresses the diffusion of n-octane due to pore crowding. However, the mechanisms responsible for this observation are different, wherein preferential adsorption sites are available on the alumina surface for both CO₂ or H₂S, but not on graphite. To contribute to designing advanced EOR technologies, possible molecular mechanisms are proposed to interpret the results