you didn't say whether this was urine or poo...The first rules is... if your dog was houstrained for potty and he now is having accidents get a vet to check his urine and such, that will let you rule out a medical problem. If there is one and your trying to correct him you'll just get frustrated, cause the reason for the problem is still there.
Try that first. He is 10. That would make him somewhere around 56 to 65 years old. depending on who's calculator you use.
http://www.k9clips.com/age.html
http://www.pedigree.com/dogsandpuppies/DogAgeC alc.asp
if everything is good, then you'll have to go back to watching him like before and supervise him, at night you'll need to wake up before you THINK he is going and take him out, if you wake to late then the next night get up a bit earlier, until you get up and he hasn't gone...and keep that up. It's always best to treat when they go out and as soon as they go treat them for it, small treat size of a grain of rice for a yorkie.Going by the history you provided: I would think tho that he has a medical problem to cause this all of a sudden....and he never did it before when the female came over...as long as she has always been incontenent.
Good luck let us know if the little fellow is okay.