Have you checked her gums in the front, top and bottom?At 5 months, she could be beginning to cut her front teeth, especially on the bottom, and that could be waking her up and making her uncomfortable.
The same thing happened with my niece and her little one recently, and that turned out to be the problem. A little Baby Oragel partially took care of the problem as far as getting her to sleep, but she would still scream when she woke up during the night.
My niece was told by her pediatrician that when she cried, she should just let her cry, and if she didn't stop within 5 minutes, then to go into the room for a minute or two and let the baby see her, without picking her up or saying anything, and then to leave the room.
The first night, she was to do this every time she cried, unless, of course, it was time for her bottle, and she was hungry. The second night, she was to do the same thing, every time she cried for at least 10 minutes, and the third night, every 15 minutes, and so on.
By the end of the week, she was sleeping through the night again, except for waking up when she was hungry, and then she would go right back to sleep.
You may want to give this a try, and see if it helps....