I can't tell from your description if it is a side stitch but there's a technique for dealing with it that is likely to be successful for most and is non-invasive even if it is not.
Side-stitches come from your diaphragm moving in your breathing in an inappropriate way.
I'm sure there's a more technical explanation.
Here's not the place for listing the likely causes.
Basically you will have to retrain your breathing pattern during exercise.
In the meantime, when it strikes, try this:
Standing (not running) ...
Using the hand ehich is on the same side as the stitch, spread the thumb and forefinger wide
Thumb behind, towards the back, press the forefinger deep under your diaphragm while you are standing, bent right over, breath already out
Pull up, breathing deeply in as you come up
You might need to do it a few times.
In a figurative sense you are resetting your diaphragm pattern as you breathe.
You need to really bend over and have your forefinger deeply squeezed in, I guess to limit your diaphragm.
Works best for those with little or no abdominal fat.
I guess there's better explanations on the interwobbly, but that's the way it works for coaching runners.