Carbon capture and sequestration (CCS) in geological formations is a prominent solution for reducing anthropogenic carbon emissions and mitigating climate change. The capillary trapping of CO2 is a primary trapping mechanism governed by the pressure difference between the wetting and nonwetting phases in a porous rock, making the latter a key input parameter for dynamic simulation models. During the CCS operational process, however, the CO2 is prone to contamination by impurities from various sources such as surfaces (e.g., pipelines and tanks) and the subsurface (e.g., existing natural gas). Such contamination can strongly influence the overall CO2 wettability, storage capacity, and containment security. Hence, the present study uses the nuclear magnetic resonance (NMR) core flooding technique to investigate and compare the residual saturations of pure CO2, pure N2, and a 50:50 CO2/N2 mixture in an Indiana limestone. The longitudinal and transverse relaxation times (T1 and T2) are measured to examine the displacement process of the pore network, and the trapping mechanism is evaluated at the pore scale as a determinant of the field-scale flow behavior. The NMR T1-T2 and 2D maps are used to observe the fluid configurations in the pore network, and the T1/T2 ratios are used to evaluate the microscopic wettability of the limestone grains by the pore-space fluids following each drainage/imbibition process step. The results indicate substantial residual gas trapping in the rock for the CO2-brine, N2-brine, and CO2/N2-brine systems, corresponding to gas saturations of 25%, 27%, and 26%, respectively. In the CO2-brine system, the intermolecular interplay between the CO2-enriched brine and limestone grains results in a higher T1/T2 ratio and significantly reduces the hydrophilicity of the limestone. Furthermore, the NMR T2 distribution reveals the occurrence of preferential water displacement into the large pores (r > 1 µm) and from the intermediate pores (0.03 µm < r < 1 µm), whereas water remains immobile in the smaller pores (r < 0.03 µm). The insignificant difference in residual trapping saturation between pure CO2 and the CO2-N2 mixture indicates the potential to allow for impurities in the CO2 phase in CCS without reducing the residual trapping capacity. Thus, the present work provides comprehensive information on the impact of gas injection on residual gas trapping in subsurface geological formations at the pore scale, thereby aiding in the development of CCS and other potential applications in enhanced oil recovery (EOR).