Yahoo Inc. and China-based Alibaba Group Holding Ltd. have reached an agreement in principle to resolve their dispute over the ownership transfer of Alibaba’s online-payments business, called Alipay, according to a person familiar with the matter.