In this paper, the output-tracking problem for a class of non-affine nonlinear systems with unstable zero-dynamics is addressed. The system output must track a signal, which is the sum of a known number of sinusoids with unknown frequencies amplitudes and phases. The non-minimum phase nature of the considered systems prevents the direct tracking by standard sliding mode methods, which are known to generate unstable behaviors of the internal dynamics. The proposed method relies on the properties of differentially flat systems under mild assumptions relevant to the relation between the original output and a suitably designed flat output. As a result, the original problem is transformed into a state-tracking problem for invertible stable systems, where any internal state turns out to be bounded. Because of the uncertainty in the frequencies and in the parameters defining the relationship between system output and flat states, adaptive indirect methods are applied.