There is always a gut & Brain connection ,definitely you have to eat for your brain as well as your gut in order to sort the health issues you are facing.
It just requires a good planning interms of what foods you choose,the frequency you consume them with and the portions you take.The kind of foods you have mentioned that makes you feel better but makes you gain weight is because they lack fiber,essential vitamins & minerals hence there is disruption in metabolism to get completed resulting in increasing hunger prangs & body weight changes
Next Steps
Include a diversified meal plan at every meal in limited quantities as per age,physical activity, height and weight
Health Tips
Include variety of green leafy vegetables ,Complex, carbohydrates,coming from whole cereals pulses,lentils,seasonal fruits,low fat dairy which can provide you with the nutrients to address your health issue
Include optimal physical activity