The stable quasistationary mixing of ternary gas mixtures in a system of two chambers connected by a capillary is described by a theoretical model which predicts the density distribution of the mixture along the length of the diffusion channel. It is demonstrated that inversion of the density gradient can occur due to a nonlinear concentration distribution of the heavy component in a diffusion "gate" effect. The results obtained using this model are compared with the experimental data.