Jolly Tumuhiirwe, 22, was filmed beating, kicking and stamping on the 18-month-old child.
On Friday, she told a court in Kampala the attack was revenge after she was beaten by the child’s mother.
The mother denied beating her. Earlier charges of torture were dropped.
Chief Magistrate Lillian Buchan told Tumuhiirwe she had committed an “unjustifiable and inexcusable” crime.
She said the sentence was appropriate in light of the “ruthlessness exhibited” on an “innocent, helpless child”, reports the AFP news agency.
The video footage, which prompted the case, came from a camera the child’s father, Eric Kamanzi, had installed in his home after noticing his daughter was bruised and limping.
He reported the abuse to police last month and circulated the video online to family members. The footage was later shared more widely, provoking horror and upset internationally.
After the sentencing, Mr Kamanzi said: “It’s not for us to decide the punishment for what she committed.
“We hope this has set an example for other maids out there, that you can’t just go to someone’s house and torture their baby and expect to walk out,” AFP reports.
Another family member, Rose Zimulinda, said the child was physically well now but there were likely to be longer term psychological consequences.
In Uganda, there is no requirement for people paid to look after children to have qualifications.
Police have recommended that parents do background checks with friends, neighbours, local police, council and previous employers before taking on nannies or maids given these responsibilities.