A sieve fundamental lemma for polynomials in two variables (with an appendix by A.Schinzel and U.Zannier)