I believe there are 2 steps to do this,
first set an environment variable for the host;
SetEnvIf Host ^www\.example\.com$ domain1
SetEnvIf Host ^www\.anotherexample\.com$ domain2
Step 2 is to add the conditionals for each domain
<IfDefine domain1>
php_value newrelic.appname "Domain 1 app"
</IfDefine>
<IfDefine domain2>
php_value newrelic.appname "App for other domain"
</IfDefine>
Got info from here: http://jennyandlih.com/using-apaches-ifdefine-dev-and-production-environments and new relics example: https://docs.newrelic.com/docs/php/per-directory-settings#htaccess-apache
One caveat is for a large number of domains there will be a large number of conditionals.