That’s a pretty complicated situation you have there. Does Josh know you are pregnant with Dan’s child? Is he okay with it/does he still want to be with you? Does Dan know anything about your thoughts on leaving? Which male figure has shown greater intentions of staying committed to BOTH your children? What about your daughter? Does she respond well to her biological father?
You have several months to figure out what you really want, don’t rush into the decision. Whoever you decide to go with, make sure it’s final. I think for your daughters sake though, you should allow her to have a say. I mean, (and I only base this on the information you have given) it seems like Daniel is more responsible and committed, because he was with you while you had a 3 month old child. (I don’t think a lot of guys rush for the opportunity to raise someone else’s child). Just because Josh has finally got his head on straight, 5 years after the fact, doesn’t mean he should get off the hook so easily. Make sure he really means it and make him PROVE it. You need stability now that you are having a family. Real love may not be as obvious at first, may get buried in daily routine, but is always there and doesn’t waiver. Make sure your feelings for Josh aren’t just “romantic” feelings that are ephemeral, and visa versa.