Newbill made one of two free throws and Ross Travis missed the next two from the line. Newbill failed to convert on two more free throws in the final 14 seconds, helping the Huskers (10-9, 1-5 Big Ten) escape with the victory.
Shields went 10 of 11 from the floor and made all eight of his free throws for Nebraska. As a team, the Huskers went 16 of 16 from the free throw line.
Jermaine Marshall scored all of his 18 points in the second half for the Nittany Lions (8-10, 0-6).
Penn State trailed 33-28 at the end of the first half, but quickly went on a 12-0 run. A short jumper by Travis at the 11:56 mark of the second half put the Nittany Lions ahead at 43-41. It was their first lead since Nebraska trailed 7-6 with a little more than 13 minutes remaining in the first half.
Marshall was fouled shooting a three with 8:11 remaining, and made all three of his shots from the line to put Penn State ahead 52-48 -- its largest lead of the half.
Nebraska countered with nine straight points, capped by an easy fast break layup by Gallegos off a Newbill turnover with a more than four minutes remaining to quiet the home crowd in the Bryce Jordan Center.
Gallegos knocked down a 3-pointer a couple minutes later to fend off Penn State, who had cut the Huskers' lead to three. Marshall converted a three-point play to make the score 61-58.
Gallegos hit three 3-pointers in the game, but both teams struggled mightily from beyond the arc. Nebraska shot 4-of-13 from the 3-point line, while the Nittany Lions shot 5 of 20.
adidas Men's Nebraska Cornhuskers Scarlet Long Sleeve Shooter ShirtPrice: $47.97 Shop
The NBA draft is tonight (7 p.m. ET, ESPN/WatchESPN) and trade talk is picking up. Chad Ford dishes his latest intel on how the draft will go and which teams will make deals.
Bryce Drew inherits a talented Commodores roster that the new coach believes is good enough to compete for a title.
Jalen Rose and David Jacoby announce their choices for sleepers in the 2016 NBA Draft.