Dog Mounting, Humping, & Masturbation Causes
Get both of their anals, urinary tracts, ears and such checked out by the vet to be sure nothing medically is drawing him to her or medically stimulating him to act this way.
Try reading this long article. Read all of the pages and see if you don't find some answers here. I dislike using sprayings in the face or throwing loud cans of pennies across the floor with Yorkies as they can be fear-prone and actually, interfering, distracting and stopping him in his tracks BEFORE he goes into his behavior by watching his body language are the best ways to stop this.
Also, desensitize him to being around her by teaching him impulse control, how to stay in place for a treat, teach him "leave it" and get him working learning to obey your commands as part of a fun obedience course you teach at home. He's likely bored and gotten himself into an OCD type behavior based on stress release - a displacement type behavior that you are going to have to teach him out of.
Eventually placing him in a wire crate and treating him with juicy as you play and frolic around with her right next to the crate will help to get him used to restraining himself while she is nearby. Tossing in treats as a reward after you tell him to "Stay" or "Leave it" when he begins to focus on her as you play with her and when he does back off, not rush to the crate edge, whine, pant or act excited, and upon staying still and enduring her playing around, will in time help teach him he gets a good reward and your pride in him for controlling himself. In time, you should be able to leash him and bring him out of the crate, put him in a down stay and allow her to play around him as he stays in the down position and leaves her be. But it will take a good while of training, training, training for fun rewards and pride in him, forming a bond and then watching his body language and standing him down when he alerts to her, backing him off and the desensitizing should all begin to help.
You make the decisions in the household about how he acts around his pack-mate and in time with good training, bonding activities, learning to respect you and want to do what you say just because he's learned to do it and knows your strong leadership, showing him the way - you will have a little guy that comes to learn he cannot any longer obsess and get by with it and besides, his life will be richer and he won't need to obsess. He'll be fulfilled with his own life.