Spay or neuter your dog.
If you have not already done so, having your dog spayed or neutered can reduce incidences of territorial marking.
According to a report from the Humane Society, spaying or neutering your pet may help reduce likelihood that they will mark their territory, but it does not completely stop it.