H.V.
I have a 5 month old as well. She's been sleeping through the night since 5 weeks old. Now she sleeps from 7 pm to 7 am. I don't claim to know all the answers, all I can tell you is what I do/did. I'd suggest the book "On Becoming Babywise - Giving Your Infant the Gift of Nighttime Sleep" or more commonly known as just "Babywise". I followed a lot of the recommendations in this book for teaching your baby how to sleep. Don't feel bad if you have to let your baby cry it out a night or two. Feel good that you are doing the very best thing for your child by teaching them to be a good sleeper. Take from the book, what you like and leave what you don't.
The basics are:
1. Feed your baby (during the day) on a strict three hour feeding schedule (same schedule everyday). Such as: 7am, 10am, 1pm, 4pm, 7pm & 10pm. (until they are sleeping through the night then you may try a 4 hour schedule and see if they keep sleeping through the night)
2. When they do eat, make sure they get a full feeding (no snacking). Keep them awake any way you need to until they take in a full feeding. No eating 1 or 2 ounces and falling asleep.
3. The daytime routine should go: feeding time then awake/play time, then nap time. (i.e. no falling asleep right after eating) Except for your last evening feeding you feed then put them straight to bed.
4. Middle of the night feedings (if any) should be very quiet, in a dark room, no stimulation, then straight back to sleep.
5. Try not to get them dependent on any one thing to get them to sleep (i.e. rocking, holding, sleeping with you, on top of the dryer in the carseat). That way when your child wakes up in the night (which all people do) they can go back to sleep on their own.
When my daughter was 5 weeks old I was feeding her on a 3 or 4 hour schedule during the day. She kept waking up at 2am every night. I switched to a strict 3 hour schedule during the day (and was getting one extra feeding in) and instantly she stopped waking up at 2am. I was like DUH! It made it so obvious! She had been waking up in the night to get that extra feeding (the feeding I wasn't offering her during the day).