The Spurs were without five key players, as Kawhi Leonard (finger) and Manu Ginobili (hamstring) are still nursing injuries, and Tim Duncan (rest), Tony Parker (back tightness) and Boris Diaw (food poisoning) all got the night off.
Still, San Antonio fought for most of the way, going up by 12 in the first quarter and trailing by only one at halftime.
The Nets built an 11-point lead in the third period only to see the Spurs scratch and claw their way back into the game, trimming the lead to two at one point in the quarter.
That was when Anderson took over, with the reserve guard scoring 17 of 21 Brooklyn points between the third and fourth frames.
The Nets shot 49.5 percent from the floor and collected a season-high 53 rebounds. San Antonio hit on only 39.7 percent of its shots and grabbed 38 boards.
Cory Joseph led the Spurs with 18.
The win by Brooklyn snapped a six-game losing streak to the Spurs, and San Antonio's dominance in this matchup goes back much further than that. Even with the Nets victory in this one, the Spurs have still won 22 of the last 24 meetings between the two teams.
Brooklyn has now won 12 of its last 16 contests overall.