I was motivated to read more about proxy ARP when I was asked what is the use case of proxy ARP. I stumbled upon RFC 1027 which essentially says this:
Therefore a method for hiding the existence of subnets from hosts was highly desirable. Since all the local area networks supported ARP, an ARP-based method (commonly known as “Proxy ARP” or the “ARP hack”) was chosen.
The physical networks of host A and B need not be connected to the same gateway. All that is necessary is that the networks be reachable from the gateway.