Second-order necessary optimality conditions for nonlinear conic programming problems that depend on a single Lagrange multiplier are usually built under nondegeneracy and strict complementarity. In this paper we establish a condition of such type for two classes of nonlinear conic problems, namely semidefinite and second-order cone programming, assuming Robinson's constraint qualification and a weak constant rank-type property which are, together, strictly weaker than nondegeneracy. Our approach is done via a penalty-based strategy, which is aimed at providing strong global convergence results for first-and second-order algorithms. Since we are not assuming strict complementarity, the critical cone does not reduce to a subspace, thus, the second-order condition we arrive at is defined in terms of the lineality space of the critical cone. In the case of nonlinear programming, this condition reduces to the standard second-order condition widely used as second-order stationarity measure in the algorithmic practice.