The metric volume form is $\omega=\sqrt{|\det(g)|}dx^1\wedge\ldots\wedge dx^n.$
The divergence of $V=V^i\partial_i$ is determined by $(\text{div}V)\omega=d(V\lrcorner\omega)\equiv V(\omega),$ hence we get: $(\text{div}V)\omega=\left[V^i\partial_i(\sqrt{|\det(g)|})+\sqrt{|\det(g)|}\partial_iV^i\right]dx^1\wedge\ldots\wedge dx^n,$ Where we used the obvious formula $V(dx^1\wedge\ldots\wedge dx^n)=(\partial_iV^i)dx^1\wedge\ldots\wedge dx^n.$
Therefore $\text{div}V=\frac{1}{\sqrt{|\det(g)|}}\frac{\partial}{\partial x_i}\left[\sqrt{|\det(g)|}V^i\right]$
Edit added in reply to Asaf Shachar's comment
Probably, in the original version of my answer, I should have spent a few words justifying the following formula $V(dx^1\wedge\ldots\wedge dx^n)=(\partial_iV^i)dx^1\wedge\ldots\wedge dx^n.\tag{$\star$}$ Here, on the left-hand side, as elsewhere in my answer, I am using the expression $V(\eta)$ to denote the Lie derivative, along the vector field $V$, of a differential form $\eta$.
Recall that the vector field $V$ is locally given by $V=V^i\partial_i$ in terms of the holonomic frame $\partial_1,\ldots,\partial_n$ corresponding to the local coordinate system $x^1,\ldots,x^n$, so that $V(x^i)=V^i\tag{1}.$ Moreover, since the Lie derivative $V(-)$ is a (degree $0$) derivation of the differential graded algebra $(\Omega^\bullet(X),\wedge,d_{dR})$, we get immediately that $V(dx^1\wedge\ldots\wedge dx^n)=\sum_{i=1}^n dx^1\wedge\ldots\wedge d(V(x^i))\wedge\ldots\wedge dx^n.\tag{2}$ Now, from $(1)$ and $(2)$, it follows $(\star)$, as we needed.