Much more straightforward combinatorial proof:
$n^{n-2}$ counts the number of functions $[n-2]\to [n]$
On the other hand, if we try to count the number of functions $[n-2]\to [n]$ via inclusion-exclusion that at least one number from $[n]$ does not appear in the image... that is letting $A_k$ count the functions $f$ such that $k\notin\operatorname{Image}(f)$, we try to count $|A_1\cup A_2\cup\dots\cup A_n|$ and break apart via inclusion-exclusion.
For $1\leq n-i$ elements guaranteed not in the image, we pick which those are in $\binom{n}{n-i}=\binom{n}{i}$ ways. For each element of the domain, we pick which of the $n-(n-i)=i$ elements in the available range of not already disqualified elements of the codomain they map to which can be done in $i^{n-2}$ ways. The $(-1)^{n-i+1}$ term appears as a result of inclusion-exclusion. Altogether then we find there are $\sum\limits_{i=0}^{n-1}\binom{n}{i}i^{n-2}(-1)^{n-i+1}$ such functions.
We of course know that since $n-2<n$ there is always going to be at least one element of $[n]$ not in the image of every function $f$ from $[n-2]\to [n]$ so these must be equal.
Proof via calculus:
$(x+1)^n=\sum\limits_{i=0}^n\binom{n}{i}x^i$
Differentiate both sides with respect to $x$ to get
$n(x+1)^{n-1} = \sum\limits_{i=0}^n\binom{n}{i}ix^{i-1}$
Multiply both sides by $x$ to get
$nx(x+1)^{n-1}=\sum\limits_{i=0}^n\binom{n}{i}ix^i$
Differentiate both sides with respect to $x$ again to get
$n(nx+1)(x+1)^{n-2} = \sum\limits_{i=0}^n\binom{n}{i}i^2x^{i-1}$
Repeat this process so that the total number of derivatives performed was $n-2$ and we end with $\sum\limits_{i=0}^n\binom{n}{i}i^{n-2}x^{i-1}$ on the right. On the left, we end with some ugly expression, but that expression will necessarily have a factor of $(x+1)$ in it. This can be seen by the product rule of differentiation, that $(fg)'=f'g+fg'$, at each step of the process letting $g(x)$ refer to the $(x+1)^{n-k}$ factor noting that the derivative of $(x+1)^{n-k}$ is $(n-k)(x+1)^{n-k-1}$.
The exact expression after $k>0$ steps can be shown to be $n\frac{k-1}{~}(nx+k-1)(x+1)^{n-k}=\sum\limits_{i=0}^n\binom{n}{i}i^kx^i$ where $a\frac{b}{~}$ is notation for falling factorial
Now, plugging in $-1$ for $x$, the expression on the right is equal to your original expression. The expression on the left, having a factor of $(1+x)$ thus has a factor of $(1+(-1))$ and is thus equal to zero.
Indeed, as noted in the comments, by performing only $k$ steps in this process, this shows that $\sum\limits_{i=0}^n \binom{n}{i}i^k(-1)^i=0$ for any $0\leq k\leq n-2$.