In this paper, we introduce a stochastic predator-pray system with Markov switching. We establish the necessary conditions of near-optimal control for this system. The proof of the main results are based on Ito's formula, Ekeland's variational principle and some estimates on the state and the adjoint process with respect to the control variable.