Let $K \subseteq N$ be compact, take a sequence $p_n \in f^{-1}(K)$. Then $q_n = f(p_n)$ admits a subsequence (which we will keep on calling $q_n$) converging to some $q \in K$.
Since $f$ is a submersion, by the regular value theorem $f^{-1}(q)$ is a closed manifold (nonempty because $f$ is surjective). Therefore it admits a tubular neighborhood $U$, and endowing it (or rather, the normal bundle) with a metric, we call $D \subseteq U$ the set of all points (vectors in the normal bundle) with norm $\leq 1$. $D$ is a neighborhood of $f^{-1}(q)$ which is compact because $f^{-1}(q)$ is such, so $\partial D$ is compact as well.
Now, submersions are open maps: a submersion $f \colon M \to N$ can locally be written as a projection $\mathbb{R}^m \to \mathbb{R}^n$ onto the first $n$ coordinates, which is open, so $f$ maps a basis of open sets of $M$ to open sets in $N$. This implies that $f(D)$ is a neighborhood of $q$, so $q_n$ must lie in $f(D)$ for $n$ larger than some $\overline{n}$.
Call $g = f|_{D} \colon D \to f(D)$, then $g$ is onto, so there is a $p'_n \in g^{-1}(q_n) = D \cap f^{-1}(q_n)$ for $n > \overline{n}$. Now suppose that for arbitrarily large $n$ we could find a $p''_n \in f^{-1}(q_n) \setminus D$: since $f^{-1}(q_n)$ is (path-) connected, we would have a path $\alpha_n$ in $f^{-1}(q_n)$ from $p'_n$ to $p''_n$, which would cross $\partial D$ at a point $r_n$ (define a map $\phi \colon M \to \mathbb{R}$ assigning to points in $U$ of norm $\leq 2$ their norm, and for all other points the value $2$: then $\phi(p'_n) \leq 1 < \phi(p''_n)$, so $\phi \circ \alpha_n$ must take the value $1$). By compactness of $\partial D$, $r_n$ admits a subsequence $r_{n_k}$ converging to some $r \in \partial D$, but then
$$q \neq f(r) = \text{lim} f(r_{n_k}) = \text{lim} q_{n_k} = q $$
contradiction. Therefore $f^{-1}(q_n)$ must be definitively contained in $D$, so $p_n$ lies in the compact set $D$ from a certain point onwards: further extracting a convergent subsequence, we are done.