Ignition doesn't have any capability to expose a "remote" database provider; if you want a general purpose database connection on Gateway2, you will need to add a direct connection from Gateway2 to your primary database.
However, for the specific problem described, you can use a remote audit profile over the gateway network:
Connect the two gateways, set up your service security appropriately, and then create a "remote" audit profile on Gateway2 that points back to the DB on gateway 1. Ignition will transparently issue reads (and optionally writes) to the audit log back to gateway 1/the database.