A general invariance principle, from the output-to-state point of view, is proposed for the dynamical analysis of nonlinear time-varying systems. This is achieved by the construction of a simple and intuitive criterion using integral inequality of the output function and modified detectability conditions. The proposed scheme can be viewed as an extension of the integral invariance principle (C.I. Byrnes and C.F. Martin, 1995) for time-invariant systems to time-varying systems. Such extension is nontrivial and can be used in various research areas such as adaptive control, tracking control and the control of driftless systems. An application to global tracking control of four-wheeled mobile robots is given to demonstrate the feasibility and validity of the proposed approach.