We unify nonlinear Farkas lemma and S-lemma to a generalized alternative theorem for nonlinear nonconvex system. It provides fruitful applications in globally solving nonconvex non-quadratic optimization problems via revealing the hidden convexity.