The Suffolk singer-songwriter, 30, is close friends with the Northern Irish musician, 44, and introduced him to his partner of eight years, Friends actress Courteney Cox.
Sheeran welcomed daughter Lyra Antarctica Seaborn Sheeran with his wife Cherry Seaborn in September last year.
Speaking on The Hits Radio Breakfast Show with Fleur East, he said of Cox: “I introduced her to my best mate Johnny, who I wrote Shape Of You and Bad Habits with.
“He’s also godfather to Lyra, but yeah, I introduced them like nine years ago.
“She just invited me round her house and I just kept going round and then one day I brought Johnny and he didn’t come home.”
He also revealed that his daughter’s unusual middle name was prompted by where they believe she was conceived.
“Me and Cherry always wanted to go to Antarctica, it was always on our list,” he said.
“It’s the one continent I haven’t gone to… So we went there and it’s just an amazing place, it’s really special to us, and obviously we got home and Cherry was pregnant.
“It was just something we wanted to have in her name. I know people see it as a weird thing, but like… I mean it’s less about where she was made and more about it being special.
“I just wanted to have a connection to it… I understand it’s awkward for kids to grow up and then she’ll watch this interview and be ‘eww’.”
The chart-topping singer also said that Sir Elton John, who shares two sons with husband David Furnish, had offered him parenting advice.
Sheeran was speaking to mark the launch of his new single Bad Habits, his first track without a collaborator since 2017, on Friday.
Fleur East is on The Hits Radio Breakfast Show every weekday morning from 6am to 10am.