How scary to see her turn blue! Obviously she's doing that because she can only communicate through crying, and if you don't respond she feels powerless and ignored, so she desperately tries to get your attention. Thinking of it that way, it makes no sense to continue to let her cry. That's so cruel! She's helpless and tiny, and she only wants to be held and snuggled. By letting her cry you are continuing to set up a power struggle, worsening the problem. Isn't it alarming that at 5 months old she is already so desperate to get your attention that she would hold her breath until she turns blue? What will she do when she's 2, or 5, or 10?
Babies wake up at night for many reasons. Sometimes they need to eat, in which case filling her belly with empty calories would be a very bad idea. Sometimes they just need love and reassurance, in which case ignoring her would be detrimental to her emotional health.
In order for a child to be independent, you have to give them self confidence first. Otherwise they will seem independent, but instead they are defeated, having learned you aren't responding to their needs. They give up trying, and giving up is the very opposite of self confidence and independence. It may be good for YOU allowing YOU to sleep through the night, but what about your child? I don't know about you, but I want my children to be confident and assured, not defeated.
Responding to their cries, holding them as much as they need, and letting go of unrealistic expectations many in our society have for babies, these things will all give her the self confidence she needs. There is no such thing as a spoiled baby. It's impossible to spoil a baby with love. If babies weren't meant to be loved and cuddled they wouldn't be soft and squishy, they would be hard and spiky!
Self confidence can't be taught, it can only be developed. The way to help your child develop self-confidence is to love her, give 100% during the day and at night. Once she knows she can rely on you to always be there when she needs you, she will feel confident enough to step away from you and take independent steps.
So the answer is simple. Just love her, snuggle her, and think of her as your greatest treasure rather than a loud noise that keeps you awake at night. When you are tired the next day, drink coffee and smile thinking of how sweet and warm your baby was when you snuggled her the night before, and think of how much you love her. This time will pass quickly, only a blip in the span of your lifetime. Soon she will be grown, and you will be able to sleep all you want.
(By the way, pediatricians are NOT parenting experts. They are there to give medical advice only. If my pediatrician told me that my child needed to outgrow turning blue, I would leave and never go back!)