The 23-year-old former Real Madrid, Bolton Wanderers and Spanish under-19 defender will officially complete his move to Wearside when the January transfer window opens on Wednesday.
"Marcos is a player that I have known well for a very long time," Sunderland head coach Gus Poyet told the club's website on Monday. "He was desperate to come and play for Sunderland and he is a player I am excited to work with."
Poyet has made new signings a priority in the weeks after taking on the role in October following the dismissal of former boss Paolo Di Canio.
Sunderland have improved under the Uruguayan's guidance, recording wins over Manchester City, Everton and arch rivals Newcastle United but are still rooted in last place, two points away from safety.
Only fellow strugglers Fulham have conceded more goals than Sunderland in the Premier League this season.
The transfer will not be completed in time for Wednesday's home match against out of form Aston Villa but Alonso could make his debut in the FA Cup third round tie against lower league Carlisle United at the Stadium of Light on Sunday.
Image: Marcos Alonso
Photograph: Gabriele Maltinti/Getty Images
Take a look at what top's World Player of the Year Messi's 2014 wish list
Alpine skiing top official sees Michael Schumacher recovery chance
Michael Schumacher battling for life after ski accident
Serena rivalry making me a better player: Azarenka
Michael Schumacher an F1 great, if not the greatest...