Yes stomach problem and bad breath are related.
Next Steps
Visit dentist,if it's bcoz of dental problems like cavity or gum infection,they will advice treatment
If it's bcoz of non dental that's extraoral cause consult gastroenterologist
Health Tips
First visit dentist as most of the times bad breath is associated with dental problems