Let $G$ be a connected reductive group over a nonarchimedean field $k$ and let $\Gamma<\Gamma_1$ be congruences subgroup of $G(k)$. Let $\pi$ be an irreducible smooth admissible representation of $G$. Suppose $\pi$ is supercuspidal and $\pi^{\Gamma_1}\neq 0$.

Then $\pi|_\Gamma$ contains a cuspidal representation $\rho$ of $\Gamma/\Gamma_1$.

Therefore $\pi$ contains an extension of $\rho$ to $Z\Gamma$, $\tilde{\rho}$. So ${\rm Hom}_{Z\Gamma}(\tilde{\rho},\pi|_{Z\Gamma})\neq 0$. By Frobenius reciprocity, ${\rm Hom}_G({\rm ind}_{Z\Gamma}^G \tilde{\rho},\pi)\cong {\rm Hom}_{Z\Gamma}(\tilde{\rho},\pi|_{Z\Gamma}).$

Since ${\rm ind}_{Z\Gamma}^G\tilde{\rho}$ is irreducible, it must be isomorphic to $\pi$.

Now consider the decomposition of the induced representation into irreducible components ${\rm ind}_{Z\Gamma}^G\tilde{\rho}|_{\Gamma_1}=\oplus_{x\in Z\Gamma\backslash G/\Gamma_1} {\rm ind}_{Z\Gamma^x\cap\Gamma_1}^{\Gamma_1} (\tilde{\rho}^x|_{Z\Gamma^x\cap\Gamma_1}).$

where $Z\Gamma^x=x^{-1}Z\Gamma x$ and $\tilde{\rho}^x$ is the obvious representation of $Z\Gamma^x$ (transport $\tilde{\rho}$ through conjugation by $x$, i.e., $\tilde{\rho}^x(x^{-1}hx) = \tilde{\rho}(h)$ for $h\in Z\Gamma$.)

When does ${\rm ind}_{Z\Gamma^x\cap\Gamma_1}^{\Gamma_1} (\tilde{\rho}^x|_{Z\Gamma^x\cap\Gamma_1})$ contain the trivial representation of $\Gamma_1$? Equivalent questions are

When is ${\rm Hom}_{\Gamma_1}({\rm ind}_{Z\Gamma^x\cap\Gamma_1}^{\Gamma_1}(\tilde{\rho}^x), \textbf{1}_{\Gamma_1})\neq 0$?

When is ${\rm Hom}_{Z\Gamma^x\cap\Gamma_1}(\tilde{\rho}^x|_{Z\Gamma^x\cap\Gamma_1},\textbf{1}_{Z\Gamma^x\cap\Gamma_1})\neq 0$?

One can show $x\in Z\Gamma$ by considering ${\rm ind}_{Z\Gamma}^G\tilde{\rho}|_{\Gamma_1}$. If this contains the trivial representation, then ${\rm ind}_{Z\Gamma}^G\tilde{\rho}|_\Gamma$ contains an irreducible representation, say $\tau$, such that $\tau_{\Gamma_1}\supset\textbf{1}_{\Gamma_1}$.

This implies that $\tau$ is trivial on $\Gamma_1$. So $\pi$ contains $\rho$ and $\tau$. (A weaker approach is to use explicit representatives for $Z\Gamma\backslash G/\Gamma_1$.)

General theory implies that $\rho$ and $\tau$ intertwine, i.e., there exist $x\in G$ such that ${\rm Hom}_{\Gamma^x\cap\Gamma}(\rho^x,\tau)\neq 0.$

This implies $x\in Z\Gamma$. Using cuspidality of $\rho$ plus reps for $\Gamma\backslash G/\Gamma$, we have that $\rho\cong\tau$.

It follows that $\pi^{\Gamma_1}=\tilde{\rho}|_{\Gamma_1}$. In particular, ${\rm dim}\, \pi^{\Gamma_1}={\rm dim}\, \tilde{\rho}={\rm dim}\, \rho.$

References
L. Morris, Tamely ramified supercuspidal representations, Ann. Sci. École Norm. Sup. (4) 29 (1996), no. 5, 639–667.
A. Moy and G. Prasad, Unrefined minimal K-types for p-adic groups, Invent. Math. 116 (1994), no. 1-3, 393–408.