I would like to consider this question When does a null integral implies that a form is exact? (also related to Top deRham cohomology group of a compact orientable manifold is 1-dimensional), but for manifolds with boundaries.
1. Stokes' theorem for a manifold without boundary
Let $M$ be an oriented n-manifold with no boundary and let $\omega\in\Omega^n_c(M)$.
If $\omega=\mathrm{d}\eta\ $ for some $\eta\in\Omega^{n-1}_c(M)\quad\Longrightarrow\quad\displaystyle\int_M\omega=0$
2. "Inverse" of Stokes' theorem without boundary
Let $M$ be an oriented and connected n-manifold with no boundary and let $\omega\in\Omega^n_c(M)$.
If $\displaystyle \int_M\omega=0 \quad\Longrightarrow\quad\exists\eta\in\Omega^{n-1}_c(M) \ /\ \omega=\mathrm{d}\eta$
This is a direct consequence of the isomorphism $[\omega]\in H^n_c(M)\mapsto\int_M\omega\in\mathbb{R}$, given by the De Rham theorem for top-graded forms.
3. The Stokes' theorem with boundaries
Let $M$ be an oriented n-manifold with boundary $\partial M\overset{\imath}{\hookrightarrow} M$ (with the induced orientation) and let $\omega\in\Omega^n_c(M)$
If $\omega=\mathrm{d}\eta\ $ for some $\eta\in\Omega^{n-1}_c(M)\quad\Longrightarrow\quad\displaystyle\int_M\omega=\int_{\partial M}\imath^*\eta$
4. "Inverse" of Stokes' theorem with boundary?
Let $M$ be an oriented and connected n-manifold with boundary $\partial M\overset{\imath}{\hookrightarrow} M$ and let $\omega\in\Omega^n_c(M)$ and $\alpha\in\Omega^{n-1}_c(\partial M)$.
If $\displaystyle \int_M\omega=\int_{\partial M}\alpha\quad\Longrightarrow\quad\begin{array}{l}\exists\eta\in\Omega^{n-1}_c(M)\\\exists\gamma\in\Omega^{n-2}_c(\partial M)\end{array} \ /\ \begin{array}{l}\omega=\mathrm{d}\eta\\\alpha=\imath^*\eta+\mathrm{d}\gamma\end{array}$
My question is what additional hypotheses are required? Notice that once we prove that $\omega$ is exact, then the existence of $\gamma$ is a consequence of Stokes' theorem over $\partial M$ (which has no boundary).
Notice also that if $\omega$ is non-exact, then we can always find $\alpha$ (by de Rham's theorem) such that
$$\int_{\partial M}\alpha=\int_M\omega\in\mathbb{R}$$
so this question is actually equivalent to prove that $H_c^n(M)=0$ if $M$ has boundary.