It happened early Saturday in the 4500 block of Rosemary Lane near Keith Road.
Deputies were called to a report of a shooting in the area when they found the child had suffered a gunshot wound to her ankle, according to the Harris County Sheriff's Office.
The girl was taken to a hospital and is expected to recover, deputies said.
Her family was sleeping at the time and had no idea who may have opened fire from outside, investigators said.
Investigators had few leads on the shooter, but were canvassing the area looking for evidence.
Overnight, @HCSOTexas units responded to a drive-by shooting at the 4500 blk of Rosemary Ln. Preliminary info: units found a 7-yr-old child had sustained a gunshot wound to her ankle. Child was transported to the hospital. No other details at this time. #HouNews pic.twitter.com/hYFN4PDQIb— Ed Gonzalez (@SheriffEd_HCSO) July 24, 2021