Unfortunately not. The gyroscope and proximity sensor are all mounted to the motherboard of the Galaxy S5. The replacement process is extremely high risk and most technicians would not be able to perform the task correctly. It requires some very specialized micro soldering and that does not come cheap. On top of the fact that the only way to get to your motherboard in that phone is to remove your LCD screen which in most cases of an unskilled technician would end up in LCD damage.
You may be able to sell it to a local repair center for parts. Just don't tell them too much about the motherboard failure and they may pay more for it.