De Castro will join Yahoo in January. He will oversee global sales, operations, media and business development.
According to a filing, De Castro will be paid $600,000 (£372,600) a year and will receive a $1m one-time bonus within seven days of the start of his employment. His compensation package includes $36m in a combination of stock options and restricted stock.
Since March, he has been working vice president of Google’s partner business solutions worldwide, where he was responsible for advertising platforms and services for Google’s publisher and commerce partners. The filing did not confirm whether De Castro would be replacing anyone in his new role.
Prior to joining Google, de Castro worked at Dell and McKinsey. His is the second significant appointment that Yahoo has made from its rival Google, after former Google executive Mayer was appointed as chief executive earlier this year.
Mayer said in a statement: "[De Castro's] operational experience in internet advertising and his proven success in structuring and scaling global organizations make him the perfect fit for Yahoo! as we propel the business to its next phase of growth."
She also announced the hiring of De Castro on Twitter, adding it was her first full day back in the office after giving birth to her son last month.
The news comes following a string of high-profile appointments made by Mayer, who joined the business herself in July, including the hire of Kathy Savitt, the former Amazon vice president, as global chief marketing officer.