Ameer Abdullah ran for 116 yards on a career-high 31 carries, and Martinez finished with 104 yards as the Huskers pounded away on the ground on a windy afternoon at Memorial Stadium.
The Huskers (8-2, 5-1 Big Ten), down 14 points at half, got TD runs of 1 and 2 yards from Imani Cross to tie it at 20.
Martinez threw 56 yards to Kyler Reed on a third-and-5 and, three plays later, found Turner on a short slant in the end zone for a 27-23 lead with 10:57 left.
Penn State (6-4, 4-2) looked ready to regain the lead, but tight end Matt Lehman fumbled into the end zone and Nebraska recovered. The fumble call was confirmed on video review.
A Nebraska safety and field goal put the game out of reach.
The Huskers remain in control of the league's Legends Division. They finish the regular season with a home game against Minnesota and a visit to Iowa. Already this season, the Huskers made up double-digit deficits in the second half to beat Wisconsin, Northwestern and Michigan State.
Zach Zwinak led the Lions with 141 yards on 21 carries. Quarterback Matt McGloin was 18 of 37 passing for 240 yards, with one interception. Allen Robinson caught six passes for 97 yards for Penn State.
Martinez, just 6 of 14 for 56 yards in the first half, completed all six of his second-half passes and finished with 171 yards through the air.
Nebraska opened the second half with an impressive eight-play, 75-yard drive. Martinez provided the big plays, hitting Kenny Bell with a 22-yard pass that was tipped and picking up 21 on a quarterback draw before Cross scored from the 1.
Nebraska got the ball right back after Baker Steinkuhler sacked McGloin and safety Daimion Stafford jumped a route for an interception he ran back 22 yards to the Penn State 4. Cross carried twice, going into the end zone untouched from 2 yards to tie it.
Penn State answered with a 35-yard field goal to go up 23-20 after Kyle Carter couldn't hang on to what would have a touchdown pass on the previous play.
The Lions were in position to go ahead after moving from their 25 to the Nebraska 3. But Lehman, after catching a pass, got hit by David Santos and dropped the ball in the end zone.
Stafford recovered for a touchback to end the threat with 7:39 left.
After the game, referee John O'Neill said in a statement, "The ruling on the field was a fumble short of the goal line. It went to replay and the replay official said the play stood based on the views he had. It's ultimately his decision."
The Lions had to start their next series after Brett Maher matched his career high with a 69-yard punt.
McGloin was called for intentional grounding after getting chased to the back of the end zone by Cameron Meredith and Eric Martin. The play resulted in a safety, and Nebraska led 29-23.
Penn State got another chance but turned over the ball on downs when Justin Blatchford broke up a McGloin pass at the Lions' 25.
Maher added a 33-yard field goal, his third of the game.