Since $H$ is a smooth function and $\Gamma$ is a closed curve traversed in period $T$, the fundamental theorem of calculus gives $\int_0^T \frac{d}{dt} H(x(t), y(t))\, dt = H(x(T), y(T)) - H(x(0), y(0)) = 0$. Along $\Gamma$, we have computed $dH/dt = \varepsilon(g_2 f_1 - g_1 f_2)$. Since $\varepsilon \neq 0$, dividing by $\varepsilon$ gives the result.