Spencer, a former LSU guard, had a 3-pointer in the first extra session and keyed an 8-0 run in the second with a jumper in the paint for newest Big Ten member Nebraska (2-0).
Maurice Jones scored 18 points for the Trojans (1-1), but his shot to win at the end of the first overtime bounced off the rim.
The Trojans trailed by six in the second overtime before Alexis Moore hit a 3-pointer and DeWayne Dedmon made a basket to draw them within one with 9 seconds left.
Spencer then hit a pair of free throws and Jones' high-arcing jumper missed as time expired.
The two teams played down to the wire for the third time in as many meetings. The Cornhuskers won the previous two games by a combined five points, and just like in those games, the Trojans had shots to tie or win in the final seconds.
USC led by four points with 2:42 to go in regulation before Nebraska scored four in a row to tie the game at 49 and force overtime.
Aaron Fuller scored three consecutive points to put USC ahead 52-49 in the first overtime, then Spencer hit a 3-pointer that tied it at 52 with 42 seconds left. Fuller, an Iowa transfer, added 13 points and Moore had 11.
Jones drove between two defenders and hit a go-ahead scoop shot to give USC a 54-52 lead with 7 seconds left. Toney McCray was fouled and made both free throws to tie it. Jones' shot to win hit the rim and bounced away, forcing the second overtime.
The Cornhuskers led by seven in the second half before Jones got aggressive, alternately driving the basket and hitting from long range to bring his team back. He scored 11 points in the final 9:55, including seven in a row.
The Cornhuskers led 25-23 at halftime. Neither team shot better than 33 percent, and they combined for 10 turnovers.