San Francisco has districts for planning, districts for Supervisors, and districts for real estate. None of them align.
The San Francisco MLS uses the below map to categorize what neighborhood a property will be in. When a property is entered into the San Francisco MLS it will be auto-assigned a neighborhood base on it's geographic location. Realtors cannot manually adjust or override the neighborhood designation.

Districts are Geographic Areas
San Francisco has 10 general real estate regions. They begin in the NorthEast corner of the city and work counterclock-wise north of the I-280 freeway, with D10 essentially everything south of I-280. San Francisco district numbers are rarely used in normal conversation, and they roughly correlate to geographic areas.
For example, District 2 is the Sunset/Parkside area and District 4 the West of Twin Peaks neighborhood, District 7 is the North End while District 10 is Southeast San Francisco.
Subdistricts are Neighborhoods
What normal humans think of as neighborhoods are sub-districts in the San Francisco MLS. Within each district area are individual neighborhoods, 90 in all: 89 across the city itself, plus Treasure Island (which includes Yerba Buena Island) in District 9. For example, District 2 contains the Inner, Central, and Outer Sunset, the Inner, Central and Outer Parkside, and Golden Gate Heights.