Proof (divergence theorem for scalar field)
Apply the divergence theorem with $\v F=\phi\v a$ where $\v a$ is an arbitrary constant vector: $$ \int_V \nabla\cdot(\phi\v a)\,dV = \int_{\partial V} \phi\v a\cdot d\v S $$ so $$ \v a\cdot\bigg(\int_V \nabla\cdot\phi\,dV - \int_{\partial V}\phi \,d\v S\bigg) = 0. $$ Since this is true for all $\v a$, the result follows.