Probably not directly. You would have to connect a console to the system via the optical audio channel. As far as I know, this is missing from the PS5.
What does work, however, is: Connect the system with HDMI to the ARC HDMI connection of the TV. Then you can define the audio output (TV speakers or system) via the remote control. Connect the PS5 to the other output and play as usual. At least that's how it works with the PS4.
I don't have a PS5, but I do have a PS4. PS4 is connected directly to the Samsung TV. The home cinema system is set as the sound output there. Runs without problems.