Lots of people have dogs in apartments and work full time jobs! I have two dogs (a big one and a medium one) in an apartment and work 8 hours a day and they are still happy. Lots of awesome dog owners keep their dogs happy in apartments in their free time!
If you are committed to keeping your dog happy and understand that every single day you’ll have to exercise her to make up for your lack of a yard, and probably provide additional enrichment or stimulation, and you’re willing to make that work, then I don’t think it’s selfish to keep your dog. If you feel that she will have a higher quality of life with your old neighbour (which is completely reasonable! Situations change and sometimes keeping a dog isn’t the best option), then maybe letting her go there is better. No one can make this decision for you, but also remember that this does’t have to be a forever decision. You’re allowed to try it out and then change your mind.
I feel for you anon, because I also worried for a long time that me keeping my large active dog in an apartment was unfair. Whichever option you choose, it sounds like you have your dog’s best interests at heart and that’s what makes you a good dog owner.