While stress related headaches often stem from trying to solve problems intellectually and just trying to push through a stressful situation, stress related stomach pain is more likely to come from emotional imbalance.
Self-doubt, loss of willpower, anxiety, a sense of fear or loss, or any other strong emotion may cause stomach pain. After an emotional shock one of the first reactions of the body is to cleanse itself and the contents of the stomach. When stressed the reaction is generally not as strong as to cause a harsh bodily response, but enough to cause a feeling of uneasy pain.
When we are stressed we pay less attention to nutrition. We may eat too much, eat less, drink too much alcohol, smoke etc. Either of these might ease our mental state just a bit, but they put our bodies under additional stress and is not helpful at all for easing the stomach.
When dealing with stress related stomach pain, the first step is ensuring the physical well-being of the stomach and consuming only healthy nourishment in appropriate quantities. After this, focusing on emotional self-reflection and self-control might help.