Mike Dunlavey is right in his comment; it's just the Newton's Second Law of Motion.
Take a small cube of water. Since, there are no shear forces in a static fluid, pressure at any place is same in all directions.
The net force in the cube exerted in the faces perpendicular to $x$ axis parallel to the base of the cube (neglecting higher order derivatives of $p$) is given by $(p - \left(p + \partial_x p~\Delta x\right))\Delta y\Delta z$ where '$\partial_x$' denotes the partial derivative with respect to $x\,.$
Similarly, taking into consideration all the other faces, the resultant force is
$$-~(\partial_x p + \partial_y p + \partial_z p)~\Delta x\Delta y\Delta z = -~\nabla p ~\Delta x\Delta y\Delta z\,.$$
Then for the cube to be in equilibrium, $$-\nabla p + \mathrm F_\textrm{others} = 0\,.~~~~~~~~~~~~~~~~~\textrm{Newton's Second Law of Motion}$$
If the force can be expressed as the gradient of a scalar potential $\varphi,$ per unit mass, then
$$\underbrace{-\nabla p - \rho\nabla \varphi = 0}_\textrm{equation of hydrostatics}\,.\tag{I}$$
(If $\rho$ is constant, then the second term is a pure gradient term. Hence,
$$\begin{align}\nabla(p +\rho\cdot \varphi) &= 0\\ \implies~~~~~~~~ p + \rho \cdot \varphi &= \textrm{constant} \end{align}$$)
In the general case, the shear stress is non-zero for there exists internal force in the flowing fluid. So, there exists viscous force $\mathbf F_\textrm{viscous force}$. Hence, the equation of motion for an element of fluid per unit volume is given by $$\rho \times (\textrm{acceleration}) = -\nabla p - \rho \nabla \varphi + \mathrm F_\textrm{viscous force} ~~~~\textrm{Newton'
s Second Law of Motion}\tag{II}$$
where
$\begin{align}\textrm{acceleration} \equiv \dot{\mathbf v}(x,y,z,t) & = v_x ~\partial_x\mathbf v + v_y ~\partial_y \mathbf v + v_z~\partial_ z \mathbf v + \partial_t \mathbf v \\ & = (\mathbf v\cdot\nabla) ~\mathbf v + \partial_t \mathbf v\tag{III}\,.\end{align}$
Putting $\rm (III)$ in $\rm (II),$ we get
$$\underbrace{\frac{\partial \mathbf v}{\partial t} +(\mathbf v\cdot\nabla )~\mathbf v = -\frac{\nabla p}{\rho} -\nabla \varphi + \frac{\mathbf F_\textrm{viscous force}}{\rho}}_\textrm{General equation of motion of a fluid element per unit volume}\,.\tag{IV}$$
For, ideal "dry liquid", $F_\textrm{viscous force} = 0.$ This concludes OP's result as $\rho ~\dot{\mathbf v} = -~\nabla p + \mathbf F ,$ the latter term happens to be conservative in most cases.
References:
$\bullet$ Lectures on Physics Vol. 2 by Feynman, Leighton, Sands.