The animal apparently was washed inside by the high water Monday night, said Luiz Claudio Farias, a captain of firefighters in the north-central city of Parauapebas.
When the woman went to clean up the following day, she saw the boy playing with something behind the couch, Farias said. It turned out to be a gator.
"She snatched the boy away and called us," he said.
Farias said it was lucky the reptile apparently wasn't in the mood for a meal: "If he was hungry, he could have seriously hurt or even killed the boy."
Firefighters trapped the alligator and took it to a nearby environmental preserve, where they set it free.
"Cities in this region were built very near rivers and the rain forests, which is why it is not uncommon to see animals like alligators and snakes entering people's houses," Farias said.
He declined to identify the woman or her son.