In this paper, a state‐constrained optimal control problem is considered for the new mechanochemical model in biological patterns modelling the skin coating of some vertebrate marine animals. The model consists of the time‐dependent Ginzburg–Landau equation for the concentration difference of at least two pigments u coupled with the Swift–Hohenberg equation for the difference of dermal cellular densities of at least two types of cells. The objective is to force the state to be as close as possible to a desired state. Considering that the cost functional is discontinuous, which along with state constraint, we apply a new penalty functional to approximate the cost functional, in this case, so we first prove the existence of optimal control. Then we derive the necessary optimality conditions for the approximating optimal control problem. Finally, the necessary optimality conditions is obtained by considering the limits of the results for the approximating optimal control problem.