I think as long as the two kids have different middle names, it will be fine. So you can refer to your friend's baby as Mary Beth and your kid as Mary Anne, for example. I spent elementary school as Laura S. because there was always another Laura. And I have two cousins named Andrew so one is Big Andrew and the other is Small Andrew. It would be good to bring this up with your friend before your kid is born so she doesn't think you're just copying her.
Reply to Best friend chose the same baby name - what would you do?