An Invariance Principle for Certain Dependent Sequences