Alamak, this sounds like Braxton-Hicks contractions lah, very normal at 5 months, especially when you've got gas or your stomach feels uncomfortable. A few of my mum friends also experienced the same thing, tengah-tengah pregnancy memang perut akan keras-keras sesekali, terutama kalau ada angin or nak kencing. But since you're worried, better check with your doctor or midwife just to be sure everything's okay, especially if it comes with bleeding or severe pain ye.