Ainslie and television presenter Georgie Thompson, both 37, were sailing close to Branson's Necker Island, in the British Virgin Islands, after marrying in December when their boat developed a problem with its sail furling system.
After they called for help, Branson dispatched members of his watersports team to prevent the vessel being wrecked on a reef, before inviting the honeymooners to stay with him for a couple of days.
"Unfortunately we had a mechanical failure with the mast furling system, which, for just the two of us, was a bit much to try to fix on our own," Ainslie, the most decorated Olympic yachtsman in history, told Sky Sports News.
"We were very lucky that we were right next to Necker Island and some of the guys from the sailing centre, I have to say, were absolutely amazing and between the four of us we managed to sort out the situation.
"Then Richard very kindly phoned up and invited us over for dinner."
Ainslie and Branson have experienced trouble at sea together before, having been forced to abandon an attempt to break the Atlantic crossing record in 2008 when winds and high waves damaged their boat.