I looked up the factorization and it is $13\cdot769$, but I have no idea how quadratic reciprocity allows you to deduce this without knowing it.
I thought maybe $(\frac{9997}{p})=(\frac{a}{p})(\frac{b}{p})$ with $ab=9997$ but I don't know if you can go anywhere from there, or if that is useful. Can somebody help me out? Also $9997=1 \bmod 4$ which will probably be useful. Thanks.
As far as I know, quadratic reciprocity doesn't let you factor numbers. However, it does allow you to test for primality. We use Jacobi symbols (or possibly Legendre symbols) to calculate $$\left(\frac{5}{9997}\right)=\left(\frac{9997}{5}\right)=\left(\frac{2}{5}\right)=-1$$
If $9997$ were prime, then these are all Legendre symbols and we would also know that $5^{(9996/2)}\equiv -1\pmod{9997}$. However, we calculate $5^{(9996/2)}\equiv 5628\pmod{9997}$. Hence these are not Legendre symbols, i.e. $9997$ is composite. $5$ serves as a witness to this.