A dog at the center of a lengthy custody battle in Somerset County will be returned to its owners, a district court judge ruled Monday.