This use case is not tested and not officially supported. I suggest you try this in a new workspace on a new dummy project to not mess up your production stuff. If working well you can apply to real project.
There is no easy recommended way to do this in CubeIDE. CubeIED currently bundles two toolchains one built by us, and one from GNU ARM Embedded. Both slightly old. To be addressed at a later point.
Anyway, you could probably go to this folder (identifiers differnt on your system, but you get the point):
C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-arm-embedded.7-2018-q2-update.win32_1.0.0.201904081647\tools
Backup this content, then replace with the latest GCC toolchain downloaded from ARM.
Your project will however still not by default use this toolchain so you have to go to Project Properties > C/C++ Build > Settings > Toolchain version.
Here change from "Default" to "Fixed" and switch Type from "GNU Tools for STM32" to "GNU ARM Embedded".
That should make sure that the toolchain you copied into the tools folder is called.