Given $M_1$ and $M_2$ you construct a machine $M$ that on input $w$ does the following:
- it runs $M_1$ on the first $w$ inputs ($\epsilon$,0,1,00,01,..) for $w$ steps each.
- if $M_1$ accepts some input, you run $M_2$ on the same input and check it accepts too. (note, $M_2$ may not halt!)
- If $M_1$ rejects some input, you run $M_2$ for $w$ steps and verify it doesn't accept during that time.
- you do the same with $M_2$: run $w$ steps on each of the first $w$ inputs, and verify everything works, or reject otherwise
- if all checks pass - accept. Otherwise reject.
The idea is the following: as long as $M_1$ and $M_2$ behave the same, you will keep accepting all $w$'s. but as long as you find a difference, then you will reject that $w$ and all inputs $w'>w$, thus the accepted language becomes finite. You should be careful because machines may not halt. For instance, $M_1$ may reject some input, but $M_2$ won't halt on it -- still, they both "reject" it, and this case should be carefully analyzed.