Installed gcc with Homebrew, now how to use that gcc instead of clang?
First, examine your $PATH variable.
echo $PATH

The gcc from homebrew should reside in /usr/local/bin and when that is listed before the Xcode version of gcc/clang, you’re done - the local compilers will be called unless a package is hard coded to the full path of a different compiler than the one you have in /usr/local
If you change the PATH variable - be sure to log out of the shell or rehash the shell as appropriate.
This answer has an elegant solution using aliases as well - so you don't even have to think or care about path if you have more than one gcc installed. It goes deeper to let you choose which version of gcc to call if you happen to install more than one version.