There is also a nice proof of this fact (which I first saw in Milnor-Stasheff's Characteristic Classes) which involves decomposing the class $\eta(\Delta) \in H^*(M \times M)$ obtained as the Poincare dual of the diagonal $\Delta \subset M \times M$.
I'll assume $M$ is a compact (not necessarily oriented) $n$-manifold and use $\mathbb{Z}/2$-coefficients. If $M$ is oriented one can use coeffecients in any field. In addition I will assume $n$ is even. It simplifies the argument, and by another theorem in that book, the Euler characteristic of an odd dimensional compact manifold is zero -- so we won't miss out on much.
Theorems 11.10 and 11.11 on p. 128 show: for each basis $b_1, \dots, b_r$ for $H^*(M)$ there is a dual basis $b_1^\vee, \dots, b_r^\vee$ characterized as follows: if $\mu \in H_n(M)$ is the fundamental class of $M$, then
$$
\begin{equation}
\label{eq:1}
\tag{1}
\langle b_i \smile b_j^\vee , \mu \rangle =
\begin{cases}
1, & \text{ if } i = j \\
0, & \text{ otherwise }\\
\end{cases}
\end{equation}
$$
Note that $\deg b_i^\vee = n - \deg b_i$ In terms of the $b_i, b_i^\vee$, we have
$$
\begin{equation}
\label{eq:2}\tag{2}
\eta(\Delta) = \sum_{i=1}^r (-1)^{\deg b_i}b_i \times b_i^\vee \in H^n(M \times M)
\end{equation}
$$
Here's how we use the fact that the diagonal is the diagonal: If $\tau: M \times M \to M \times M$ sends $(x, y) \mapsto (y, x)$, and $\tau^* : H^*(M \times M) \to H^*(M \times M)$ is the induced map on cohomology, one can show $\tau^* \eta(\Delta) = \eta(\Delta)$. Substituting in the above formula, we have
$$
\eta(\Delta) = \tau^*\eta(\Delta) = \tau^*(\sum_{i=1}^r (-1)^{\deg b_i}b_i \times b_i^\vee) = \sum_{i=1}^r (-1)^{\deg b_i} (-1)^{\deg b_i \cdot \deg b_i^\vee} b_i^\vee \times b_i
$$
$$
\begin{equation}
\label{eq:3} \tag{3}
= \sum_{i=1}^r (-1)^{\deg b_i (n - \deg b_i + 1)} b_i^\vee \times b_i = \sum_{i=1}^r b_i^\vee \times b_i
\end{equation}
$$
where I've used that $(-1)^{\deg b_i (n - \deg b_i + 1)} = 1$ since $n$ is even and $\deg b_i \cdot (1 - \deg b_i)$ is always even.
Now when we self-intersect the diagonal, substitute formula \eqref{eq:2} for one copy of $\eta(\Delta)$ and formula \eqref{eq:3} for the other:
$$
\begin{equation}
\label{eq:4} \tag{4}
\eta(\Delta) \smile \eta(\Delta) = (\sum_{i=1}^r (-1)^{\deg b_i}b_i \times b_i^\vee) \smile (\sum_{i=1}^r b_i^\vee \times b_i )
\end{equation}
$$
$$
\begin{equation}
\label{eq:5} \tag{5}
= \sum_{i, j} (-1)^{\deg b_i} b_i \times b_i^\vee \smile b_j^\vee \times b_j
\end{equation}
$$
$$
\begin{equation}
\label{eq:6} \tag{6}
= \sum_{i, j} (-1)^{\deg b_i} (-1)^{\deg b_i^\vee \deg b_j^\vee} b_i \smile b_j^\vee \times b_i^\vee \smile b_j
\end{equation}
$$
$$
\begin{equation}
\label{eq:7} \tag{7}
= \sum_{i, j} (-1)^{\deg b_i} (-1)^{\deg b_i^\vee \deg b_j^\vee} (-1)^{\deg b_i^\vee \deg b_j} b_i \smile b_j^\vee \times b_j \smile b_i^\vee
\end{equation}
$$
Long overdue simplification of the factors of $(-1)$: the factor of $(-1)$ on the $i, j$ term of the sum is
$$
(-1)^{s} \text{ where } s = \deg b_i + \deg b_i^\vee \cdot (\deg b_j + \deg b_j^\vee) = \deg b_i + \deg b_i^\vee \cdot n
$$
Since $n$ is even, $(-1)^s = (-1)^{\deg b_i}$, and we've shown
$$
\eta(\Delta) \smile \eta(\Delta) = \sum_{i, j} (-1)^{\deg b_i} (b_i \smile b_j^\vee) \times (b_j \smile b_i^\vee)
$$
Finally, pairing with the fundamental class $\mu \times \mu$ of $M \times M$ and recalling equation \eqref{eq:1}, we see that
$$
\langle \eta(\Delta) \smile \eta(\Delta), \mu \times \mu \rangle = \sum_{i, j} (-1)^{\deg b_i} \langle b_i \smile b_j^\vee , \mu \rangle \cdot \langle b_j \smile b_i^\vee , \mu \rangle
$$
$$
\label{eq:8} \tag{8}
= \sum_i (-1)^{\deg b_i} = \sum_i (-1)^i \dim H^i(M)
$$