The 26-year-old had been scheduled to play Louisa Chirico of the United States in round three on Wednesday, but pulled out during the warm-ups.
Belarusian Azarenka said she will have medical tests before deciding whether to play in Rome before the French Open, which starts on 22 May.
Her departure means the top five seeds are out of the Spanish tournament.
Agnieszka Radwanska, Angelique Kerber and Garbine Muguruza exited in previous rounds while fifth seed Petra Kvitova lost 6-3 6-4 to Australia's Daria Gavrilova on Wednesday.
Azarenka, who had recently won titles at Indian Wells and Miami, said she "tweaked'' her back during her opening Madrid match against Laura Robson and that the pain persisted during her second round victory over Alize Cornet.
She follows world number world 13 Lucie Safarova - who had to withdraw earlier in the week with food poisoning - and British number one Johanna Konta who retired in the first round with a respiratory illness.
The men's event also lost Roger Federer - the world number three another player out with a back injury.
Never want to miss the latest tennis news? You can now add this sport and all the other sports and teams you follow to your personalised My Sport home.
Fourth seed Victoria Azarenka has joined the list of Madrid Open withdrawals with a back injury.