Selective carbon capture from exhaust gas and biogas, which mainly involves the separation of CO2/N2 and CO2/CH4 mixtures, is of paramount importance for environmental and industrial requirements. Herein, we propose an interesting metal-organic framework-based nanotrap, namely ZnAtzCO3 (Atz− = 3-amino-1,2,4-triazolate, CO32− = carbonate), with a favorable ultramicroporous structure and electrostatic interactions that facilitate efficient capture of CO2. The structural composition and stability were verified by FTIR, TGA, and PXRD techniques. Particularly, ZnAtzCO3 demonstrated high CO2 capacity in a wide range of pressures, with values of 44.8 cm3/g at the typical CO2 fraction of the flue gas (15 kPa) and 56.0 cm3/g at the CO2 fraction of the biogas (50 kPa). Moreover, ultrahigh selectivities over CO2/N2 (15:85, v:v) and CO2/CH4 (50:50, v:v) of 3538 and 151 were achieved, respectively. Molecular simulations suggest that the carbon atom of CO2 can form strong electrostatic Cδ+···δ−O-C interactions with four oxygen atoms in the carbonate ligands, while the oxygen atom of CO2 can interact with the hydrogen atoms in the triazolate ligands through Oδ−···δ+H-C interactions, which makes ZnAtzCO3 an optimal nanotrap for CO2 fixation. Furthermore, breakthrough experiments confirmed excellent real-world separation toward CO2/N2 and CO2/CH4 mixtures on ZnAtzCO3, demonstrating its great potential for selective CO2 capture.