The weather wasn’t perfect — 46 and drizzling. The crowd wasn’t, either — 33,273, the fewest ever announced at TCF Bank Stadium. And the football wasn’t always crisp Friday night — the Gophers and Indiana combined for seven turnovers.

In the end, however, the Gophers got what they desperately needed. Their 38-31 victory over the Hoosiers ended a four-game losing streak, took away at least some of the sting of the blowout loss the previous week at Nebraska and provided a tangible result to point to in Big Ten play.

A win over Indiana, of course, won’t be confused with beating Ohio State in the Horseshoe or Michigan at the Big House. And squandering a 31-9 third-quarter lead by coughing up the ball three times in the second half produced that “uh-oh” feeling. Still, when Tanner Morgan connected with Rashod Bateman for a 67-yard touchdown pass with 1:34 left in the fourth quarter, the Gophers (4-4, 1-4 Big Ten) could celebrate.

“Great learning opportunities for our players to be able to take away from. But at the end of the day, they found a way to win,’’ Gophers coach P.J. Fleck said Sunday on his WCCO Radio appearance.

One of those players who showed Friday that he’s a quick study is Morgan, a redshirt freshman making his first start in place of injured true freshman Zack Annexstad. Morgan was sharp from the get-go, with completions of 15 and 25 yards to Bryce Williams and Bateman on Minnesota’s first two plays from scrimmage. He completed his first six passes, nine of his first 10 and went 12-for-14 for 203 yards and two touchdowns as the Gophers built a 21-9 halftime lead. He finished 17-for-24 for 302 yards and three TDs with one interception.

Morgan spread the ball around to six different pass-catchers but relied most heavily on his go-to guys: Bateman (four catches, 108 yards) and Tyler Johnson (five catches, 102 yards, two TDs). Fleck pointed to how close the call was to pick Annexstad over Morgan to be the starter out of training camp.

“Tanner has improved a lot since then. He’s having great success because of how hard he’s worked in those eight to nine weeks,” Fleck said on WCCO. “… Even when Zack was the starter, we talked that at some point throughout the year, you’re going to have your opportunity.”

The Gophers also received a boost from the 2018 debut of running back Shannon Brooks, who rushed 22 times for 154 yards and a touchdown. With Mohamed Ibrahim out because of an undisclosed injury, Brooks gained tough yards inside and had no carries for negative yardage. But he did lose two fumbles and suffered a right knee injury while making a cut early in the fourth quarter. Fleck did not provide a specific update on his injured players Sunday.

Minnesota’s defense, which entered the game 13th in the Big Ten with 43.3 points allowed per conference game, showed signs of improvement through the first three quarters. The Gophers defense held Indiana (4-5, 1-5) to three first-half field goals and had a stretch in which it forced three punts and intercepted a pass, helping Morgan and Co. build that 31-9 lead. However, after a short punt and a lost fumble by the Gophers, Indiana started its rally with Peyton Ramsey’s TD passes of 43 and 37 yards. Ramsey’s 29-yard fourth-down scramble to the Gophers 3 set up the tying TD with 3:57 remaining.

“We had three or four times to put the game away and we didn’t do it,” Fleck said. “… Without the turnovers, the game’s ended.”

Instead, the Gophers needed the late heroics from Morgan and Bateman, which were set up by linebacker Blake Cashman’s key third-down tackle for loss that forced Indiana to punt. Rush end Carter Coughlin’s strip sack of Ramsey ended the Hoosiers’ final possession.

On Saturday at Illinois, the Gophers will try to win their second consecutive Big Ten game against the lowly Illini (3-5, 1-4), who are allowing 47.6 points and 569 yards per conference game. A win in Champaign would put the Gophers one victory from reaching bowl eligibility, with home games against Purdue and Northwestern and a trip to Wisconsin remaining.

Fleck was having none of the bowl talk on Sunday. “We’re not worrying about that right now,” he said.

Randy Johnson covers college football for the Star Tribune. Twitter: @RJStrib E-mail: rjohnson@startribune.