There is a way!
There is a way to do as you ask, but it might be unfair if red had no gold, but once it is mined he will get more gold. Here's what you do:
1. Make a small region just surrounding the gold mine. Then, if you can, make a small region just surrounding the Town Hall/whatever you are using to return the gold to.
2 = No region around Town Hall, 3/4 = Region around Town Hall:
2. Make this trigger:
-Events:
--Unit enters (Region around Gold Mine)
-Conditions:
--Unit-Type is equal to (Type of unit used to mine)
-Actions:
--Player - Properties; Remove 5 gold from Player 1 (Red)
--Player - Properties; Add 5 gold to Player 2 (Blue)
3. Make this trigger:
-Events:
--Unit enters (Region around Gold Mine)
-Conditions:
--Unit-Type is equal to (Type of unit used to mine)
-Actions:
--Turn on Trigger (Return to Town Hall)
4. Add this trigger to help out the last one. Make sure this one is not initally on:
Suggested Name = Return to Town Hall
-Events:
--Unit enters (Region around Town Hall)
-Conditions:
--Unit-Type is equal to (Type of unit used to mine)
-Actions:
--Player - Properties; Remove 5 gold from Player 1 (Red)
--Player - Properties; Add 5 gold to Player 2 (Blue)
Hopefully this solves your problem.