Gray's jumper extended the Golden Bears' lead to 68-65 with 1:01 to go, and both teams failed to score on their next possessions.
With 5 seconds left, Washington worked the ball to Kelsey Plum for a tying 3-point attempt. Cal's Brittany Boyd stripped the ball before Plum could get a shot and Boyd made two free throws to cap the scoring.
After trailing 54-46, Cal (15-7, 7-4 Pac-12) pulled even at 56 and took the lead for good at 65-64 on a Gennifer Brandon's jumper with 2:29 left.
Boyd had 12 points and nine assists and Mikayla Lyles added 12 points and four 3-pointers for Cal.
Jazmine Davis and Talia Walton led Washington (12-10, 5-6) with 20 and 19 points, respectively. Plum added 16 points and nine assists.