The inhomogeneous cosmological model with generalized nonstatic Majumdar-Papapetrou metric is considered. The scalar field with negative kinetic energy and some usual matter sources of the gravitational field such as two-component nonlinear sigma model and perfect fluid are presented. Some exact solutions in these models are obtained and analyzed. In particular it is shown that the latent mass effect and effect of accelerating expansion (quintessence) of the Universe exist in these models. The 5-dimensional generalization of the model is presented, too.