We analyze the control problem of the stochastic Navier–Stokes equations in multi-dimensional domains considered in Benner and Trautwein (Math Nachr 292(7):1444–1461, 2019 ) restricted to noise terms defined by a Q-Wiener process. The cost functional related to this control problem is nonconvex. Using a stochastic maximum principle, we derive a necessary optimality condition to obtain explicit formulas the optimal controls have to satisfy. Moreover, we show that the optimal controls satisfy a sufficient optimality condition. As a consequence, we are able to solve uniquely control problems constrained by the stochastic Navier–Stokes equations especially for two-dimensional as well as for three-dimensional domains.