Oakland, CA – Kevin Durant scored 33 points and made the go- leading Oklahoma City 116.
Durant also pulled down 10 rebounds and dished out seven assists for the Thunder, who improved to 11-4 on the road this season. Russell Westbrook added 31 points and made two key free throws with 1.1 seconds remaining.
James Harden and Daequan Cook donated 19 and 17 points, respectively, for Oklahoma City, which holds a 20-5 record.
"Our guys never gave up. We fought back and continued to believe in each other," Thunder head coach Scott Brooks said.
Ellis had a career-high 48 points and seven rebounds for the Warriors, who have dropped two straight. David Lee had a triple-double with 25 points 11 boards and 10 assists.
Cook's three-pointer cut Oklahoma City's deficit to one, 112-11, with 3:40 to play. The next points didn't come until there was 1:48 left, when Westbrook made a jumper to put the Thunder in front.
After Stephen Curry was called for traveling, Durant put home a slam to make it 115-112 with 1:23 left.
Dorell Wright made 1-of-2 from the foul line at the other end to make it a two-point game. The score was the same following a Westbrook turnover and a missed three-pointer by Durant.
Ellis drove to the hoop and made a layup while being fouled by Serge Ibaka. Ellis made the free throw to give Golden State a 116-115 lead with 22.3 seconds to go.
Durant missed a floater at the other end, but the Warriors knocked the ball out of bounds. This time around, Durant used the glass on an 18-foot jumper to give Oklahoma City a 117-116 edge with 14.2 seconds to play.
Westbrook made two free throws after Ellis missed a three-pointer. Down by three with 1.1 ticks left on the clock, Brandon Rush got the ball and missed a shot from beyond the arc.
"It was just going in for me tonight," Ellis said. "Unfortunately we didn't get the win. Our effort was there, we played them hard the whole game and it just came down to one shot."
Golden State scored the first eight points of the game and led throughout the entire first quarter. The home team held a 35-29 margin after 12 minutes.
The Thunder started the second period on a 13-2 run to take the lead. The visitors led by as many as 10 in the frame and took a 59-57 edge into the locker room.
Golden State responded in the third quarter and built an 80-68 lead with 5:07 remaining. But the Thunder scored seven of the final nine points in the stanza to cut their deficit to 93-91.
Neither team led by more than seven in the final period.
Oklahoma City beat Golden State by a 120-109 margin on January 27 in Oakland...Durant came into Tuesday's game averaging 31.3 points per game in 15 career meetings against the Warriors...Lee's second career triple-double was the first by a Warriors power forward since Chris Webber in 1993...Curry had 16 points and 10 assists...Each team shot over 52 percent from the field.