UPDATE:
We now have easier support for PS4/5 controllers in Unreal with the new “Game Input for Windows” plugin: Game Input for Windows - Experimental Release Notes
Original answer:
I want to clarify something regarding the Dualshock input plugin in Unreal Engine. Currently and unfortunately that only works for projects where the developers have the PlayStation SDK installed, which only studios that are registered on the Sony PlayStation dev network can do.
If you don’t have access to the Sony PlayStation dev network there’s currently no easy way to get PS5 controllers just “plug and play” working with your Unreal Engine game that I know of.
When it comes to alternatives:
-
DS4Windows runs locally on the user’s computer, so anyone wanting to play the game with a PS controller would need to install it to get the PS5 controller working.
-
If you’re releasing on Steam then it handles the input rebinding for you, so Steam customers would get it working easily but not other storefronts, nor if you’re just launching the executable directly. You might be able to test it by adding your game’s executable as a “non-Steam game” and running through that.
-
There might be some marketplace assets adding unofficial PS5 controller support, a brief search on the marketplace shows “SimpleController” claiming PS controller support. I haven’t tested it and can’t vouch for it.
-
Raw Input might work, seems the video that @SupportiveEntity linked goes that route. I might need to try that one

Hopefully in the future Windows will somehow have the PS4/5 controllers recognized as General Controller Input Devices which DirectX would handle abstracting away for all games and engines.