It can be that the application is already started before you set the system property for the gateway address. As a result, the application client/worker uses the wrong address and can’t connect to Zeebe inside the test-container.
Please check if the system property is set before the application client/worker is started.
It may help to setup the test-container statically for the test class.