It's all about legality. Ethically, yes, you should keep the dog. Legally, you don't have any ground to stand on if you don't have a signed owner-surrender contract. If she was given for free the 'wife' could charge you with theft and claim she doesn't know about the dog being given away, as dogs are considered 'property' according to the law.
I once posted this earlier when a AC officer told me that if you have someone else's dog in your possession without the owner's consent, you can/will be charged with theft by the legal owner. This also goes for found dogs. That's why you always need a signed surrender contract, stating the the owner of the dog willingly surrenders 'said dog' (description, breed, age, color etc) and won't have the rights to reclaim the dog after signing of the contract.
And...if you find a dog, in order to legally protect yourself, you have to bring it to a shelter and ask for the first right of refusal if you want to keep that dog if its owner is not re-located within a certain amount of days (but probably will be neutered/spayed). Or, according to our AC, you post this found dog at least 3 different ways so the public can take notice like Facebook, posters, ad in the local paper, reporting it to AC etc. In that case the stray time is 30 days before you can clam the dog as yours (in our county).
After that register the dog for a licence, vet clinic etc. to get your name on its paperwork asap.
Good luck, I hope the dog can stay with you.