A teen girl was shot early Tuesday while her brother and friends were playing with a handgun in Queens, police and law enforcement sources said.

The 13-year-old girl, identified as Carissa Samaroo, was found with a gunshot wound to the stomach and back at 1 a.m. in a courtyard of Baisley Pond Park, and was rushed to Long Island Jewish Medical Center, where she was stable, according to police and sources.

Cops detained the girl’s brother and two friends after witnesses said the group was playing with the firearm in the park when it went off, sources said.

Samaroo’s brother, Devin, 14, told cops he was shooting the gun at a trash can when it ricocheted and hit his sister, sources said.

The kids’ mother, Rohanie Singh, told The Post that her son was “given the gun by somebody on the street. It was never his” and said the shooting was “accidental.”

Devin admitted in front of Singh that he had two more guns in the closet at home, which have since been confiscated by police, sources said.