Niang was taken to a hospital in Dakar on Saturday evening after his health deteriorated as a result of his latest hunger strike, said Moussa Sarr, one of his lawyers.
In a case that has sparked international concern, Niang was arrested on November 6 and charged with "divulging information likely to harm national defence."
He went on a hunger strike on December 2 and was later admitted to a clinic after his health deteriorated. He was given provisional release, but arrested again on December 20, when he started another hunger protest.
Niang, the head of the Dakar Matin online news site, is widely followed in Senegal for his regular columns on current affairs.
The case against him arose after he wrote about rape charges being faced by the country's main opposition leader, Ousmane Sonko.
He is accused of describing confidential messages about security arrangements for Sonko's interview with investigators on November 3, according to trade unions.
His detention sparked a wave of criticism from the press, civil society groups and Senegal's opposition, many of whom called for his release.
Senegal's 2022 Press Freedom Index ranked it 73rd out of 180 countries -- a fall of 24 places compared with the 2021 assessment.