Indiana (15-3, 3-4) squandered a 13-point, second-half lead as Nebraska (10-8, 2-5) posted its biggest victory as a new member of the Big Ten.
Jordan Hulls missed on a driving layup, then recovered the loose ball and missed a desperation shot from in front of his bench as time ran out. The ball bounced back toward Hulls, and he kicked it in defeat as Nebraska's student section emptied and rushed the court.
But Nebraska, coming off a five-point loss at Wisconsin on Sunday, wouldn't quit after the Hoosiers looked to have taken control.
The Hoosiers were up 69-66 with 39 seconds left after Hulls made two free throws.
Spencer missed on the other end, but Talley followed with a putback, and it was a one-point game.
Brandon Richardson fouled Hulls in the backcourt on Indiana's next possession, and the point guard missed the front end of a one-and-one with 24 seconds to play.
That allowed Nebraska to set up its winning possession.
Richardson, who rebounded Hulls' missed free throws, fed Diaz and the 6-foot-11 center went right to the basket. He got fouled by Hulls and then made the tying free throw. After Indiana called timeout, he calmly swished the go-ahead free throw.
Indiana was within seconds of posting its first Big Ten road win against an opponent other than Penn State under fourth-year coach Tom Crean. The Hoosiers are 2-29 in conference road games since Crean took over.
Playing in Lincoln for the first time since 1942, the Hoosiers led by eight points in the first half and were up 41-34 at the half after shooting 62 percent from the floor. Spencer scored 15 points in the first 20 minutes to keep the Huskers in it.
But the Huskers went more than 5 minutes without a field goal to start the second half and fell behind by 13 points.
Indiana, however, scored just one field goal in the last six minutes.