There was a writer's strike back in the early TNG days, and they had to hurriedly rewrite one of the Phase II scripts to become a TNG episode. That episode is "The Child". Originally, it was going to be Ilia having the baby, and Decker was going to play the part Riker ended up with.
You are absolutely right. I've NOW seen both episodes. The Next Generation episode of "The Child" was one of my favorites. I had no idea that is was taken from another series (Phase II). However, I really liked the one in Next Generation than the one in Phase II. The Phase II script just seemed kinda weak to me.