Here's a determinant free proof.
Lemma: Let $A$ be an $m\times n$ matrix and $B$ be an $n\times m$ matrix over some field $F$. If $\lambda\,(\neq 0)\in F$ then $\dim\ker(\lambda I_m-AB)^k = \dim\ker(\lambda I_n-BA)^k$ for all $k\in\mathbb N$.
Proof:
Consider this linear map, which is in essence, restriction of $B$ to a subspace of its domain.
$\begin{array}{ccc}T_1:&\ker(\lambda I_m-AB)^k& \longrightarrow & \ker(\lambda I_n-BA)^k\\ &v&\longmapsto&Bv\end{array}\tag*{}$
Show that $T_1$ is injective. Well that's easy, just show that $\ker T_1$ is trivial.
Let $v\in\ker(T_1)\subseteq \ker(\lambda I_m-AB)^k$ then we have $T_1(v)=Bv =0$.
Also, $(\lambda I_m-AB)^k\,v=0$
$ \displaystyle\implies \left(\lambda^k I_m + \sum_{i\,=\,1}^k\binom{k}i\lambda^{k-i}(-AB)^i\right)v=0$
$\displaystyle \implies \lambda^k\, v - \left(\sum_{i\,=\,1}^k\binom{k}i\lambda^{k-i}(-AB)^{i-1}A\right)\!Bv=0$
$\displaystyle\implies \lambda^k \,v = 0$
$\implies v=0\quad\because\lambda\neq 0$
Thus, $v\in\ker T_1\implies v=0$.
Using first isomorphism theorem on $T_1$, we see that $\ker(\lambda I_m-AB)^k$ is isomorphic to some subspace of $\ker(\lambda I_n-BA)^k$.
$\therefore \dim\ker(\lambda I_m-AB)^k\leq \dim\ker(\lambda I_n-BA)^k$.
Likewise define,
$\begin{array}{ccc}T_2:&\ker(\lambda I_n-BA)^k& \longrightarrow & \ker(\lambda I_m-AB)^k\\ &w&\longmapsto & Aw\end{array}\tag*{}$
Show that $T_2$ is injective.
It follows that $\dim\ker(\lambda I_n-BA)^k\leq \dim\ker(\lambda I_m-AB)^k$.
Hence, we conclude that $\dim\ker(\lambda I_m-AB)^k = \dim\ker(\lambda I_n-BA)^k$.
Conclusions drawn from the lemma:
- If $\lambda\neq 0$ is an eigenvalue of $AB$ then $\lambda$ is also an eigenvalue of $BA$.
- Generalized eigenspaces w.r.t. $\lambda$ of $AB$ and $BA$ have same dimension so $\lambda$ has same algebraic multiplicity in both the characteristic polynomials $\chi_{AB}$ and $\chi_{BA}$.
Considering $AB$ and $BA$ as matrices over a field in which both their characteristic polynomials split and using the above argument, we conclude that $\chi_{AB}(x)$ and $\chi_{BA}(x)$ are same except for multiplicity of the factor $(x-0)$.
Thus, $x^{n}\,\chi_{AB}(x) = x^{m}\,\chi_{BA}(x)$. (This balances out the degree on both sides.)
We have $x^{n}\det(I_m-AB)=x^{m}\det(I_n-BA)$.
Now, Sylvester's determinant equality is a particular case of $x=-1$. $\blacksquare$