This paper deals with a stochastic recursive optimal control problem, where the diffusion coefficient depends on the control variable and the control domain is not necessarily convex. We focus on the connection between the general maximum principle and the dynamic programming principle for such a control problem without the assumption that the value is smooth enough; the set inclusions among the sub- and super-jets of the value function and the first-order and second-order adjoint processes as well as the generalized Hamiltonian function are established. Moreover, by comparing these results with the classical ones in Yong and Zhou [Stochastic Controls: Hamiltonian Systems and HJB Equations, Springer-Verlag, New York, 1999], it is natural to obtain the first- and second-order adjoint equations of Hu [Probability, Uncertainty and Quantitative Risk, 2 (2017), 1].