V.W.
My husband grew up in a slightly similar scenario. No drugs involved or foster care...long story short he and his brother were adopted by his grandparents. They had been raised by his mother/father and grandparents primarily in the grandparents house for about 4 years before the adoption took place. When the adoption took place, the kids' last names were changed and the kids' mother 'became' their "sister". To this day they call her by her first name.
Hubby's sibling still has a warped sense of familial relationships. Their legal siblings are biologically their aunt/uncles/mom. Their legal nephews are their biological cousins. When biological mom remarried and had additional children.. they became (legally) nieces/nephews but are actually biological half-brother/sisters. It is very weird. When hubby fills out medical/legal documents, he must consider how he references his relatives.
My husband was blessed and managed to emotionally sort most of this out through the years and has a functional relationship with his mother/sister today. His brother, for years, had a very dysfunctional stormy relationship with mother/sister. (Grandparents are long since deceased). The mother and her parents (the grandparents) went for YEARS without speaking.
It was very convoluted. My husband says that things would have been far better if only the grandparents hadn't changed their last name and had the kids call them "mom and dad" and call their biological mom "sister". There is a lot of emotional scarring from that. But, they were old enough to have memories and not just infants.
I cannot suggest whether you should or shouldn't go forward with the foster plan. But while you are deliberating, consider long term aspects. Do you plan to foster with the intent to formally adopt? Do you plan to raise her as your own daughter, or will she know she is really your niece? These are questions you should address now, rather than after the fact. If your BIL and his gfriend are as messed up as you say.. you must consider what is best for the infant. As you said yourself.. they will find out that you have her... how will that affect the child? It might affect your marriage and make your lives very stressful, and maybe you can handle all that... but what effects will it have on the baby long term? THAT is the answer you need to figure out. When you do.. you will know whether you should proceed or not.
Bless you and your family, whatever you decide.