Officers were called in the early hours of Sunday after reports of a party being held at a property in the south of Brazil's capital.
Gambling is illegal in the country and the gathering also violated lockdown restrictions due to the coronavirus pandemic.
Barbosa, 24, spoke to officers on the premises and was taken to the police station before being allowed to leave.
"There was a lack of sensitivity on my part," Barbosa told Globoesporte shortly after being released. "I apologise to Flamengo fans, to all the children in Brazil who like me, to the people of Sao Paulo because I was wrong.
"I don't have a habit of playing. The only thing I play is video games. I'm not a person to appear in stories like this, nor was I ever a guy to break the lockdown. I've been at home all this time. It was my last day of holiday.
"I met with friends and we had something to eat. I should have known that it was not the ideal place for me to be in. I was always wearing a mask, I had gel sanitiser. But I made a mistake, I apologise. I'm very young and I know I'm going to make mistakes. I have to learn."
Barbosa denied reports that he hid underneath a table to avoid being arrested when the police arrived and said he cooperated with the officers.
"When I saw that there were a few more people than there should be, I decided to leave," he added. "I was about to enter the elevator to leave when the police arrived and asked everyone to lay on the floor. It was a big scare.
"I did what they told me. They took me to a room and spoke to me, I told them that I would help with whatever was necessary.
"Had I been hiding, I wouldn't have left as I did, with my head held high. I got in the police car as they asked and went to the police station to give my account of events."
More than 275,000 people have died in Brazil from the COVID-19 pandemic and Sao Paulo was among the cities in the country that tightened restrictions last week after seeing an increase in cases.