As this is the top result on Google and the answer provided by HS447 https://stackoverflow.com/a/70934790/6049116 does work if you use Azure CLI; just make sure you use the correct ID:s.
az ad app owner add --id <Application (client) ID> --owner-object-id <Enterprise Application Object ID>
If you try to use the App Registration Object ID
instead of the Enterprise Application Object ID
you get an error similar to: "The reference target 'Application_<REDACTED>' of type 'Application' is invalid for the 'owners' reference."