Speaking about his recruit, Brentford boss Mark Warburton told the club's official website: "We have tracked Marcos for the last 18 months and we hoped to sign him last summer.
"He comes to us having played the majority of games for Almería in La Liga last season. He has been playing against the best teams in Europe and has shown his quality. We are delighted that Marcos has decided to join us."
Ramiro made one senior appearance for Madrid back in 2010 against Osasuna.