Ronaldo personally contacted fellow countryman Castro to convince him to take the Al Nassr job, sources said.
Thursday's Copa Sudamericana group game against Magallanes will be Castro's last game in charge of Botafogo.
Castro will put pen to paper on a two-year contract with Al Nassr, with an option to extend the deal for a further season.
Castro's contract with the Rio de Janeiro based club expires at the end of the year and Al Nassr will pay Botafogo €2.3 million as part of his release clause.
The club from Rio de Janeiro issued a statement to address Castro's future: "Regarding the media reports around coach Luis Castro, Botafogo informs he has signed a contract with the club until March 2024"
"Botafogo is preparing for an important match this Thursday, against Magallanes, for Conmebol Sudamericana where the group first place is in play...Everyone is fully focused on tonight's game."
He has guided the Alvinegro to 42 wins, 14 draws and 23 defeats in 79 games in charge.
Botafogo have enjoyed a strong start to the season, winning 10 of their 12 league games. They lead Brazil's top flight, seven points clear of nearest rival Gremio.