My dd weighed significantly less at age 2 than she did at age 1. A pediatric gastroenterologist determined what her food intolerances and allergies were, and also some intestinal abnormalities and we got a lot of help. She ended up seeing the GI, a pediatric feeding disorders specialist, a nutritionist, and several other professionals.
As an experienced "medical mystery" parent, I can tell you what will be useful at the appointment.
1. Start now by keeping a food journal. If you are breastfeeding, keep a detailed log of what you eat and drink, and be specific (not "snack" but "whole grain toast and fresh strawberries" or "brown sugar cinnamon Pop Tart" or whatever). If you are not breastfeeding, keep a journal of exactly what formula she drinks and how much and when. It's easiest to use a legal pad, and use one page per day. Keep a separate log of medications given - how much and when - and be specific.
2. Keep a similar journal for activities. I know she's only 5 months old, but for example: "woke up at 5 am, had 2 ounces of formula, cried for 30 minutes, slept for 2 hours, put her in the stroller and walked to park..." etc. If she goes to any caregiver's house or relative's house, they must do the same.
3. Note the products you use for baby shampoos, baby lotions and soaps, detergents, etc. Specify the brands you use.
4. Start a questions page for yourself. As questions arise in your head prior to the appointment, write them down. Some might be "does she have enough Vitamin D?" or some might be hunches, like "it just occurred to me that my cousin's baby went through this same thing two years ago, and I remember my grandma telling me that my mom didn't gain weight as a baby and how worried she was". Think back about family history, and ask yourself if any chronic diseases or medical conditions have been diagnosed in your or her dad's immediate family.
5. Keep an organized medical file and have it ready. I have a briefcase-like thing that I got at an office supply store with pockets inside. I keep my pockets organized by year, but you of course would keep yours organized by month. Keep copies of tests run, results, doctors' notes, formula changes, in each month's pocket. I also put Post-it Note Flags on the most significant test results and the serious medical emergencies that have occurred, and I keep a reference sheet of what the flags mean. For example, one doctor will say "when was the first time your daughter's blood work showed positive Lupus markers?" and I can look at my reference sheet and it will say "first Lupus markers, 2012 pocket, blue Post-it Flag" and I can pull it right out. You might do the same for, say, when your daughter's doctor first said she was lactose intolerant. The point is to be organized, to be able to retrieve info immediately, and to be thorough.
And yes, as Diane B said, take notes at the appointment. I look like a court stenographer when we're at the Mayo Clinic. I jot down everything, even if I can't spell it, I spell it phonetically, and later, Google will help me look it up. Write down the names of doctors and nurses and therapists and other providers who interact with you (not every technician who comes in to draw blood, but the ones with whom you'll be interacting routinely).
I hope you can get the help for your daughter that she needs.