I think it's easier to look at exponentials. The reasoning is exactly the same, but if a sine or cosine were used, we would need two exponentials. So first let's say that $$x[n]=e^{j2\pi\frac{f_0}{fs}n} $$
Then the DFT is $$\begin{align}
X_N[k]&=\sum_{n=0}^{N-1}e^{-j\frac{2\pi}{N}kn}e^{j2\pi\frac{f_0}{fs}n} \\
&=\sum_{n=0}^{N-1}e^{-j2\pi n\left ( \frac{k}{N}-\frac{f_0}{f_s} \right)} \\
&=\frac{1-e^{-j2\pi N\left(\frac{k}{N} -\frac{f_0}{f_s}\right)}}{1-e^{-j2\pi \left(\frac{k}{N} -\frac{f_0}{f_s}\right)}} \mbox{, where } k=0,\ldots,N-1
\end{align}$$
For this to be a delta, we need the following condition to be satisfied:
$$
N\left(\frac{k}{N}-\frac{f_0}{f_s}\right) \in \mathbb{Z} \Rightarrow k-N\frac{f_0}{f_s} \in \mathbb{Z}
$$
With this condition, the numerator is always zero. The denominator will be zero if $$ \frac{k}{N}-\left.\frac{f_0}{f_s}\right\vert_{k=k_0}=0 \mbox{, or } k_0=N\frac{f_0}{f_s}$$
At that particular $k_0$, you will need to use L'Hospital's Rule.
This will give you the complete DFT as $$X_N[k]=\begin{cases} N &\mbox{ if } k=N\frac{f_0}{f_s} \\ 0 &\mbox { else} \end{cases} \mbox{, } k=0,\ldots,N-1$$
So what conditions did we impose to get this result? Just that $k-N\frac{f_0}{f_s} \in \mathbb{Z}$. Since $k$ is already an integer, we need only check $N\frac{f_0}{f_s}$. Define $f_s=af_0$. Therefore $a$ is the number of points in a cycle. Then we need $$\frac{N}{a} \in \mathbb{Z}$$
This can only be satisfied if $a$ is an integer, and $N$ is an integer multiple of $a$.
Putting all this together, if the sampling frequency is an integer multiple of the input's frequency, and $N$ is an integer number of points in a cycle of the sampled exponential, then the DFT of $x[n]$ will be a delta with height $N$.