New Relic doesn't officially support MariaDB, but it may work. The New Relic plugin requires that it can connect via TCP. You can test this by trying to connect locally over TCP.
For mysql you would run something like: mysql -u newrelic -pPASSWORD -hHOST --protocol=TCP
The JDBC drivers that work with MySQL may not work the same way which could mean that this plugin will not work correctly with MariaDB.