The current investigation is focused on the development of composite membranes based on polymeric ionic liquids (PILs) containing imidazolium and pyridinium polycations with various counterions, including hexafluorophosphate, tetrafluoroborate, and bis(trifluoromethylsulfonyl)imide. A combination of spectroscopic methods was used to identify the synthesized PILs and characterize their interaction with carbon dioxide. The density and surface free energy of polymers were performed by wettability measurements, and the results are in good agreement with the permeability and selectivity obtained within the gas transport tests. It was shown that the membranes with a selective layer based on PILs exhibit relatively high permeability with CO2and high ideal selectivity CO2/CH4and CO2/N2. Additionally, it was found that the type of an anion significantly affects the performance of the obtained membranes, with the most pronounced effect from bis-triflimide-based polymers, showing the highest permeability coefficient. These results provide valuable insights into the design and optimization of PIL-based membranes for natural and flue gas treatment.