
A DualShock 4 cannot control GTA VI when you play directly on a PS5. Sony supports the older controller for compatible PS4 games running on that console. The PlayStation release of GTA VI is a PS5 game.
Why the same pad worked in another game
Check which version of the other game you were running. A backwards-compatible PS4 title can accept DualShock 4 on a PS5. That explains why the controller can work on the same hardware but still be unsuitable for GTA VI. For a standard PS5 gamepad, use DualSense.
Source: PlayStation GTA VI support, PlayStation Blog — PS5 hardware FAQ
Pair the DualSense before opening GTA VI
With the PS5 switched on, connect the DualSense using the supplied USB cable and press its PS button. The light bar flashes, then the player indicator lights up. Once the controller has enough charge, unplug it and try navigating the home screen wirelessly.
Source: PlayStation controller support
Sources
Interfaces and rules can change. Check the official pages above for current requirements.