The Huskies (2-1) became the first team not in a Power 5 conference or major independent to win in Lincoln since Southern Mississippi knocked off the Cornhuskers in 2004.
Northern Illinois is now 4-1 against Big Ten teams under fifth-year coach Rod Carey.
Nebraska (1-2) had two chances with the ball after Northern Illinois went ahead with 8:52 left. But Mycial Allen broke up a pass on fourth-and-7, and Tanner Lee threw his third interception of the game, allowing the Huskies to go into victory formation with 1:36 left.
"In the grand scheme of things, it's one game," Carey said. "We've been here before in a situation like this. We're 2-1. That's all it means. Are we going to enjoy it for 24 hours? You bet."
The Huskies of the Mid-American Conference returned two interceptions for touchdowns to go up 14-0 before Nebraska found a semblance of offense. Lee was sacked three times and pressured on seven other occasions.
Nebraska, which had been 3-0 against MAC teams prior to Saturday, was held scoreless in the first half at home for the first time since 2007, and the Huskers were booed as they headed to the locker room.
The Huskers have lost two of their first three for the second time in three years under Mike Riley. They had a close call against Arkansas State in their opener, got blown out in the first half of a 42-35 loss at Oregon last week and now this.
"We have to prove who we are," Riley said. "We've been, I would say, inconsistent at best. That's not even probably accurate. That's been us, and I don't like that. We've got to have a better identifying quality than being like we've been as a football team."
On the Huskers' opening possession, Shawun Lurry jumped in front of De'Mornay Pierson-El on a bubble screen for an interception and ran 87 yards untouched for NIU's first score. Later in the first quarter, Jawuan Johnson caught a floater after Lee got hit by Drequan Brown and returned it 25 yards to make it 14-0.
"We feel like we can play with anyone, play ball no matter where we're at, no matter where we go," Lurry said.
Before the Huskers scored, they had five three-and-outs, another series messed up by penalties and a field goal blocked.
"We have to prove who we are," Nebraska coach Mike Riley said. "We've been, I would say, inconsistent at best. That's not even probably accurate. That's been us, and I don't like that."
Nebraska finally broke through after Northern Illinois' Jalen Embry muffed a punt at his own 24 and Lee ran in from the 2 to cut the Huskies' lead to 14-7.
Drew Brown's 36-yard field goal made it a four-point game entering the fourth quarter, and Lee reached the ball over the goal line to put the Huskers up 17-14. The Huskies then went 75 yards in six plays to take the lead for good.
Northern Illinois: The Huskies came into Memorial Stadium confident they could win, and they capitalized on Nebraska's inept offense in the first half. Add this win to the ones Northern Illinois has posted over Iowa, Purdue and Northwestern since 2013. Don't sleep on the Huskies, who were picked third in the MAC West.
Nebraska: This one will smart. In addition to the boos, a good number of fans left at halftime and didn't come back. This one wasn't on Bob Diaco's defense. Lee has thrown a national-high seven interceptions in three games.
Northern Illinois hasn't returned two interceptions for touchdowns in a game in at least 10 years. The NIU sports information staff didn't have access to records prior to that. Nebraska had two interceptions returned for a touchdown by Ohio State last season and by Colorado in 1967.
On Nebraska's opening possession, Lurry jumped in front of Pierson-El?on a bubble screen for an interception and ran 87 yards untouched for NIU's first score.
"We had five days to watch film on them. They run a lot of bubbles, so something just told me to jump it and I just jumped it," Lurry said. "Results happen."
Later in the first quarter, Jawuan Johnson caught a floater after Lee got hit by Drequan Brown and returned it 25 yards to make it 14-0.
Northern Illinois closes nonconference play with a trip to San Diego State.
Nebraska opens Big Ten play at home against Rutgers.