Garay joined La Liga club Racing de Santander in December 2005, helping with seven complete matches as the Cantabria side barely avoided relegation. His first full season was nothing short of spectacular as he netted nine league goals in 31 games, being the second top scorer in his position in Europe's major leagues only behind Inter Milan's Marco Materazzi ; against Real Madrid only, he scored three times – 2–1 home win and 1–3 away loss – as Racing eventually finished tenth, the club's best since returning to the top flight in 2002. On 19 March2008, in the semi-finals of the Copa del Rey against Getafe CF, Garay suffered a serious leg injury which put him out of action for the remainder of the campaign. He still scored three goals in 22 contests with his team finishing in a best-ever sixth position, qualifying for the first time to the UEFA Cup– one of those came on 30 September 2007 in a 1–0 win at UD Almería. in 2011
Real Madrid
On 18 May 2008, Racing sold Garay to Real Madrid, but received the player again on a season-long loan. Returned in July 2009, he made his league debut for the latter on 29 August, in the opening game of the season against Deportivo de La Coruña, a 3–2 home win; on 12 December, after coming on as a substitute for severely injured Pepe, he scored his first goal for the club, heading in a free kick from Xabi Alonso to make it 3–2 at Valencia CF with six minutes to go. Garay was only fourth-choice stopper in 2010–11 under new manager José Mourinho, only appearing in five league matches, adding two in the Spanish Cup.
Benfica
On 5 July 2011, Garay transferred to S.L. Benfica for a fee of €5.5 million, signing a four-year contract – initially part of the deal that sent Fábio Coentrão to Real Madrid, Garay eventually signed a separate deal. Real Madrid also remained eligible for 50% of any transfer fee Benfica would receive, and the latter also sold part of his rights to Benfica Stars Fund for €1.175 million, making the club owner of 40%. During his spell in Lisbon, Garay shared teams with a host of compatriots, and often partnered with Luisão in central defence. On 24 April2014, he scored his eighth official goal of the season, netting his team's first in a 2–1 home victory over Juventus F.C. for the first leg of the Europa League semi-finals.
Zenit
On 25 June 2014, Russian club FC Zenit Saint Petersburg signed Garay in a transfer totalling €6 million, with Benfica receiving €2.4 million for their 40% part of the player's rights. He appeared in 42 games across all competitions in his first season, helping the team to their fifth Russian Premier League championship.
Valencia
On 31 August 2016, Garay joined Spanish club Valencia for a fee reported at around €20 million. He scored four goals in his debut campaign, but his side could only finish 12th. Garay was on the starting XI in the 2019 Copa del Rey Final, a 2–1 triumph against Barcelona. In February 2020, after suffering a cruciate ligament injury to his right knee which would sideline him for up to six months, he asked to be released so that another player in his position could be signed.