The purpose of this paper is to study the friction-reducing properties of 23 N-containing heterocyclic ionic liquid additives in polyethylene glycol 400 (PEG-400) or dimethyl sulfoxide (DMSO). Based on the theory of quantitative structure tribo-ability relationship (QSTR), the quantum chemical parameters of 23 N-containing heterocyclic ionic liquid molecules were calculated by density functional theory, and the friction-reducing properties of the ionic liquid additives in PEG-400 or DMSO were studied by multiple linear regression. The results show that QSTR models with excellent stability and strong prediction abilities were obtained for both polar liquids studied. Heat capacity of the ionic liquid is the main quantum chemical parameter affecting its friction-reducing performance. The friction-reducing performance of the selected ionic liquid additive in DMSO is better than that in PEG-400. A friction-reducing mechanism is also discussed.