Lengthy post. I know I tend to read into things, so I might just be rambling about something that might not even be there. I know this topic has been discussed before, usually either concluding that nobody knew who David was until he revealed it, or that Lucy knew from the moment she scanned David. Both just don't make sense to me, judging by the decisions Lucy made up until the moon BD.
If nobody knew who David was, including Lucy, then her choosing to share something that personal clashes directly with her "don't trust anybody in NC" mindset. We know that Lucy choosing to share the moon BD with David specifically was a genuine decision and not a flirty lure, as she later explained. Could've used a different BD, or distracted him another way. However, if Lucy did know David was Gloria's son, then why didn't she just bring him to the crew? Or at least let Maine know he was Gloria's son? Why set him up like that? It simply doesn't add up.
Let's start with something obvious: Maine knew Gloria. Since Maine defends her against Pilar by saying "She's good people, one of our own, just looking to make some fast scratch", as well as saying "I owe it to Gloria" after accepting to give David a chance, I think it's thus reasonable to believe that it was not just a superficial buyer-seller relation, but something more substantial. Thus meaning that there is a significant possibility the crew, including Lucy, either knew Gloria personally, only her job, or maybe just by face alone. It's somewhat of a stretch, but it kind of ties in with the moment where Gloria tells David about her being away from home so much. She could just be working for the crew besides her EMT job.
Then we know that Maine paid up front for the Sandy, which is what Gloria meant with 'payday', also explaining the other bank account David finds in Ep1, with which he pays off the medical bill. Basically meaning David is now indebted to Maine, starting the hunt.
Then we have Lucy meeting David on the NCart. She didn't know who he was until he used the implant to keep her from stealing his shard. She was surprised, noticed something was off, pulled him aside. There are a couple things that stand out here in my eyes. First, she asks "Do I know you?" in a way like she sees something familiar in David. Secondly she obviously scans and sees the Sandevistan, putting 2 and 2 together that it's Maine's missing implant (obvious duh), offering David to work together to lure him. She then says "Gonna break poor mama's heart if she finds out you know". I've seen people chalk this up to the fact that it's basically a jab at David dropping out, but I'm unsure. Why not dad, or parents, or family? Why specifically mama? And finally, David is wearing his mom's EMT jacket.
Now, you might realize that this theory depends on whether Lucy actually knew Gloria, what kind of job she worked, or what she looked like. Which I think is somewhat likely given my earlier point. Since Gloria basically ghosted Maine, as far as he was concerned, he also could've shared any information he had with the crew to help locate her. Then imagine finding a kid just the day after with the exact same Sandevistan implant, resembling Gloria, young enough to be her son, wearing an EMT jacket, and so forth. I believe it'd be unlikely for someone as smart and observing as netrunner Lucy to not connect the dots if she knew the info on Gloria.
tldr;
Lucy had to have had a reason to set up such an elaborate lure as she did. Every single scenario that has Lucy not knowing who David was, could have a simpler outcome. She could just quickhack David and bring him to Maine. Simplest option. She could've called Maine when David went out after the train ride. Also a simple option. Why would she care like that about David if all she was after was the Sandy? And if she only acted like she cared, why share that private BD?
So I'd basically boil it down to the fact that Lucy only suspected David was Gloria's son after meeting him on the train. If she was certain, she wouldn't have set up such an elaborate lure. If she didn't know David was Gloria's son at all, she also wouldn't have set up such an elaborate lure. Because she suspected it and probably recognized Gloria in David, she let down her guard, realizing that David wasn't a bad person. When David then trauma dumped in her apartment, she felt a little understood, and also recognized herself in David. That's when she decided to do that moon BD with him. She already knew it was too late since she already called Maine when David was at the ripperdoc. But the crew didn't know she shared such a personal thing with him.
Idk. I feel like it's such a stretch, but it also somewhat explains why they went on such a long day instead of Lucy just pragmatically bringing David to Maine.