It can be done where fencing is placed into whole where dog contacts when getting feet and nose under. It will take some odd placement of insulators and wire to achieve. Ideally, dog will be able to pull back easily an not get zapped repeatedly. I can see where dog owner might get upset.I can't visualize how an electric fence on the opposite side is going to stop him from digging under.
I would try the spray first to see if it works. If repelling efforts requires OP to be present, then I do not think it will be effective long term. Dog owner will get made about OP directly causing harm to dog. The fencing or spraying the ground would be less stressful for me.