The current implementation of the MySQL JDBC container allows the user to override the generated database name, user name and password using the JDBC connection URL, but the MariaDB JDBC container implementation does not.
The missing piece looks to be an implementation of JdbcDatabaseContainer newInstance(ConnectionUrl connectionUrl) in MariaDBContainerProvider.
The implementation in MySQLContainerProvider seems to be robust and not dependant on MySQL specific semantics, so I'm pretty sure it can be just copied verbatim to support the same feature in MariaDB.