Let us prove the following (this is Problem 1C.8 in M.I. Isaacs Finite Group Theory).
Theorem Let $P \in Syl_p(G)$ and $a$ a non-negative integer. Let
$$\Gamma=\{ \text{subgroups of $G$ of order } p^a\}$$
$$\Pi=\{ \text{subgroups of $P$ of order } p^a\}.$$
Then $\#\Gamma \equiv \#\Pi$ mod $p$.
Now, before proving this theorem, let's see how it follows that if $p^a$ divides $|G|$ ($p^a$ not necessarily being the largest $p$-power dividing $|G|$), the number of subgroups of order $p^a$ of $G$ is $\equiv 1$ mod $p$.
If ones takes $a$ in the theorem above such that $p^a$ is the maximum power, clearly $\#\Pi=1$ and $\#\Gamma = n_p(G)$, the number of Sylow $p$-subgroups : one recovers the third Sylow theorem. Further, in general, if $P$ is a $p$-group and $p^a \mid |P|$, then the number of subgroups of order $p^a$ is $\equiv 1$ mod $p$, see for proofs here. These two facts combined with the theorem above gives the required result: if $G$ is a finite group and $p^a \mid |G|$, then the number of $p$-subgroups of order $p^a$ is $\equiv 1$ mod $p$.
Now we need a small lemma.
Lemma Let $P \in Syl_p(G)$ and $Q$ a $p$-subgroup of $G$. Then the following are equivalent.
(a) $Q \unlhd P$
(b) $P \subseteq N_G(Q)$.
Proof (a) $\Rightarrow$ (b) is obvious: since $Q$ is normal in $P$, $P$ normalizes $Q$.
(b) $\Rightarrow$ (a). Since $P \in Syl_p(G)$ and $P \subseteq N_G(Q)$, certainly $P \in Syl_p(N_G(Q))$. But of course, $Q \unlhd N_G(Q)$ and, since Sylow subgroups are conjugate, $Q$ is contained in every Sylow $p$-subgroup of $N_G(Q)$. $\square$
Proof of the Theorem: $P$ acts on $\Gamma$ by conjugation, let $\Omega$ be the set of fixed-points. Then $Q \in \Omega$ if and only if $P \subseteq N_G(Q)$, which by the Lemma is equivalent to $Q \unlhd P$. Hence $\Omega=\{Q \unlhd P: |Q|=p^a\}$. By the Orbit-Stabilizer Theorem and the fact that $P$ is a $p$-group, we conclude $\#\Gamma \equiv \#\Omega$ mod $p$.
$P$ also acts on $\Pi$ by conjugation and the fixed points for this action are exactly the elements of the set $\Omega$. So, $\#\Pi \equiv \#\Omega$ mod $p$, yielding $\#\Gamma \equiv \#\Pi$ mod $p$. $\square$
Final observation We now know that if $G$ is a finite group and $p^a \mid |G|$, then the number of $p$-subgroups of order $p^a$ is $\equiv 1$ mod $p$. From this it equally follows that if $G$ is a finite group and $p^a \mid |G|$, then the number of normal $p$-subgroups of order $p^a$ is $\equiv 1$ mod $p$. Can you prove this?