Stokes is currently taking a break from cricket to prioritise his mental wellbeing and rest his injured finger
Deborah Stokes took legal action over the September 2019 front-page article, saying it exposed private information that was not in the public interest.
The Sun initially defended the story, but has now apologised to the family for causing "great distress".
"We should not have published the article," read The Sun's statement.
"We apologise to Deborah and Ben Stokes. We have agreed to pay them damages and their legal costs."
In 2019, The Sun told the BBC it had received the co-operation of a Stokes family member and added the events described in the story were "a matter of public record" and "the subject of extensive front-page publicity in New Zealand at the time".
Stokes was born in New Zealand and moved to Cumbria with his family aged 12.
At the time, he described the article as "utterly disgusting" and the "lowest form of journalism".
"The decision to publish this article was a decision to expose, and to profit from exposing intensely private and painful matters within our family," said Deborah Stokes.
"The suffering caused to our family by the publication of this article is something we cannot forgive.
"Ben and I can take no pleasure in concluding this settlement with The Sun.
"We can only hope that our actions in holding the paper to account will leave a lasting mark, and one that will contribute to prevent other families from having to suffer the same pain as was inflicted on our family by this article."
In July, the England and Wales Cricket Board (ECB) announced Stokes was to "take an indefinite break from all cricket with immediate effect" to prioritise his mental wellbeing and rest his injured finger.