We investigate the potential benefits of injecting the mixtures of CO2 and N2 into shale reservoirs to both optimize recovery of natural gas and to sequester CO2. In this work, we develop dual-porosity, dual-permeability finite element models to simulate multicomponent gas flow in porous media coupled with shale deformation and sorption behavior. We use this model to explore the injection of pure CO2, pure N2, and mixtures of CO2 and N2 in different ratios to enhance shale gas recovery (ESGR). This behavior necessarily includes the evolution sorption-induced strain by competitive adsorption and its influence on permeability of matrix and fractures to ultimately define cumulative production history of CH4. The results show that injecting pure CO2 can increase shale gas recovery by ∼20%. Injection of N2 works as an ESGR agent and can increase shale gas recovery by ∼80%. Injecting a mixture of N2 and CO2 of different gas ratios results in recovery ranging between ∼20% and ∼80% (pure component end-member cases). Moreover, injecting N2 in higher proportions relative to CO2 is more beneficial since N2 shows higher recovery in ESGR. Therefore, increasing injection pressure is not the only means to achieve higher production, instead, increasing N2-CO2 gas ratio can achieve the same goal. The observations also show that although CO2 is not sensitive to pressure in performing ESGR, it is sensitive to pressure when accounting for sequestered CO2. Furthermore, the sequestration of CO2 by injecting CO2-N2 mixtures does not simply increase as CO2-N2 gas ratio increases. Since higher CO2-N2 ratio results in a decrease in shale gas recovery, which leads to more CH4 left in the reservoir to compete with CO2 for sorption sites, this also results in reduced CO2 sequestration.