If $\l\neq0$ is an eigenvalue of $AB$, then $\l$ is also an eigenvalue of $BA$ and $B$ is an algebraic isomorphism from $\ker(AB-\l)$ onto $\ker(BA-\l)$ with inverse $\l^{-1}A$. Hence for all $\l\neq0$: $\dim\ker(AB-\l)=\dim\ker(BA-\l)$.
Suppose $x\in\ker(AB-\l)$, i.e. $ABx=\l x$ and thus $BABx=\l Bx$, i.e. $Bx\in\ker(BA-\l)$. Hence $B:\ker(AB-\l)\rar\ker(BA-\l)$. Moreover $\l^{-1}ABx=x$ and therefore $B:\ker(AB-\l)\rar\ker(BA-\l)$ is an isomorphism with inverse $\l^{-1}A$.