We consider an interacting pion gas in a stage of the system evolution where thermal but not chemical equilibrium has been reached, i.e., for temperatures between thermal and chemical freeze-out T(ther) < T < T(chem) reached in relativistic heavy-ion collisions. Approximate particle number conservation is implemented by a nonvanishing pion number chemical potential mu(pi) within a diagrammatic thermal field-theory approach, valid in principle for any bosonic field theory in this regime. The resulting Feynman rules are derived here and applied within the context of chiral perturbation theory to discuss thermodynamical quantities of interest for the pion gas such as the free energy, the quark condensate, and thermal self-energy. In particular, we derive the mu(pi) not equal 0 generalization of Luscher and Gell-Mann-Oakes-Renner-type relations. We pay special attention to the comparison with the conventional kinetic theory approach in the dilute regime, which allows for a check of consistency of our approach. Several phenomenological applications are discussed, concerning chiral symmetry restoration, freeze-out conditions, and Bose-Einstein pion condensation.