I'm pretty sure you're looking for Fresh (1994). It's been ages, but I still remember that scene vividly.
Michael (or Fresh as he's well known) is a 12-year-old drug pusher who lives in a crowded housing project with his cousins and aunt. His father has become a street bum, but still meets with Fresh on occasion to play chess. Fresh is rather quiet in a crazy world. Fresh's sister is a junkie who sleeps with the dealers who Fresh sells for. As the story progresses Fresh realizes that he doesn't want to sell drugs anymore, he wants out.
The girl is Rosie, who has a sort of crush on Fresh. As she comes to talk to him in a basketball court, she gets caught in the crossfire of a dispute and the scene then unfolds exactly as you've described it. You can see it briefly in the trailer around 0:25: