It's my understanding that a Jew or even an atheist can perform a baptism if they use the proper form and matter, with the correct disposition, which is, to do what the Church intends. How can an atheist have the right intention if they do not even believe that Original Sin exists?
The idea you are paraphrasing is ex opere operato, the idea that the sacrament is in itself efficacious and does not depend on the intention of either the minister or the recipient. Not all denominations hold to it. Those that do, probably have nuances in their application of it. The historical origins of this viewpoint go back to the Donatist Controversy in the 4th century. Back then the schism was between ex opere operanti and ex opere operato.
Here are a couple of links explaining them both in more detail:
From your phrasing I believe you are referring to the Catholic view. The Catechism at 1256 states:
WHO CAN BAPTIZE?
In case of necessity, anyone, even a non-baptized person, with the required intention, can baptize, by using the Trinitarian baptismal formula. The intention required is to will to do what the Church does when she baptizes. The Church finds the reason for this possibility in the universal saving will of God and the necessity of Baptism for salvation.
The "right intention" of an atheist does not mean that they themselves must believe the teachings of the Church, but only that they must intend to do what the Church does. For example, suppose an atheist is with a dying man who has minutes left to live, and the dying man asks for baptism. The baptism is valid as long as the atheist uses the Trinitarian formula and intends to do the same thing that a Christian would do in the circumstance. More or less, the atheist must think to themselves, "I intend to baptize this person according to the Christian teaching, even though I myself do not believe in Christianity."