AFAIK, if you want to use rest api to do that, seems we could just use the MS graph api : Get organization or the AAD graph GET https://graph.windows.net/{tenant id}/tenantDetails?api-version=1.6
to get the tenant name, but it just get the currently authenticated tenant.
If you want to the tenant name via a resource, you could use azure powershell to do that. As you know the subscription, specific the -SubscriptionId
with which subscription the resource in.
$TenantId = (Get-AzureRmSubscription -SubscriptionId "xxxx").TenantId
Connect-AzureAD -TenantId $TenantId
Get-AzureADTenantDetail

The DisplayName
is the tenant name.