use Bitrix\Crm\ItemIdentifier;
use Bitrix\Crm\Service\Container;
$leadID = 8939;
$child = new ItemIdentifier(\CCrmOwnerType::Lead, $leadID);
$parents = Container::getInstance()->getRelationManager()->getParentElements($child);
foreach ($parents as $parent) {
echo 'EntityTypeId: ' . $parent->getEntityTypeId() . '<br>';
echo 'EntityId: ' . $parent->getEntityId() . '<br>';
echo 'CategoryId: ' . $parent->getCategoryId() . '<br>';
}