I believe this is a special case of a more general fact; I am not sure of all the signs off the top of my head, but here is the idea. If $M$ and $N$ are orientable $d$-manifolds, the Künneth theorem gives $$H^d(M \times N; \mathbb{Q}) \cong \bigoplus_k H^k(M; \mathbb{Q}) \otimes H^{d-k}(N; \mathbb{Q}).$$ To the second factor we first apply Poincare duality $H^{d-k}(N; \mathbb{Q}) \cong H_k(N; \mathbb{Q})$ and then the usual duality $H_k(N;\mathbb{Q})\cong H^k(N;\mathbb{Q})^\ast$ to rewrite this as $$H^d(M \times N; \mathbb{Q}) \cong \bigoplus_k \text{Hom}\big( H^k(N; \mathbb{Q}), H^k(M; \mathbb{Q}) \big).$$ For any continuous map $f\colon M \to N$, the graph $\Gamma_f$ of the map $f$ is a $d$-dimensional submanifold of $M \times N$, so we can consider its class $$[\Gamma_f] \in H^d(M \times N; \mathbb{Q}).$$ Claim: under the above isomorphism, we have $$[\Gamma_f] = \bigoplus_k \big[\ f_{(k)}^*\colon H^k(N; \mathbb{Q}) \to H^k(M; \mathbb{Q}) \big]$$ where $f_{(k)}^*$ denotes the map induced on $k$-th cohomology by $f$. There might be some signs missing here, but other than that I believe this is correct. (I don't know a reference for this, so if anyone does have a reference, I'd be grateful.) In particular, it doesn't seem that you need to assume that $\phi$ is an isomorphism, only continuous, or that $M$ and $N$ are surfaces. As an aside, if you apply this twice with $M=N$, once to $\text{id}\colon M\to M$ and once to $f\colon M\to M$, you should be close to proving the Lefschetz fixed point theorem.