Grain of salt here; I haven't used a Windows machine for about 5 years now, and haven't ever used msys2.
If I remember correctly, even code built in Visual Studio will require you to ship your project with .dll object files due to dependencies even between different versions of VSC++. I remember having to track down the correct dll on my XP so that my code would run on another person's XP, not sure if it's easier now with the current version.
So as far as I know, no, you need those .dll files because you are using a different compiler than what was actually used to build your system...
And in a couple of minutes someone is going to prove me wrong on that because of my bad memory, grain of salt, right? ...
Maybe this confirms what I'm saying:
https://docs.microsoft.com/en-us/cpp/windows/determining-which-dlls-to-redistribute?view=msvc-160
Edit: I think I might have overthought the prompt. Are you asking about dependencies when distributing your code to other computers? I think we need you to clarify what exactly is going wrong. If it's how to get gcc working, then this video should help:
https://www.youtube.com/watch?v=3TAcdcaEWN0