Looks like there are two gcc versions, one is msys/gcc which is 4.9 and the other is mingw gcc which is 5.3. For a person like me who doesn't know anything about the differences between cygwin/mingw/msys etc. this is a little bit confusing.
As far as I understand, cygwin/msys gcc compiles and links against cygwin.dll/msys.dll which is a incomplete POSIX emulation on Windows. mingw gcc compiles and links against msvc.dll which is MS c runtime for MS win32 native application.