MINNEAPOLIS —It's hard to estimate the number of times Taylor Heinicke envisioned himself in the situation the quarterback stepped into Sunday night.
His team trailed by seven, only a touchdown and 2-point conversion would do. The clock had 2:44 remaining when Heinicke stepped into the huddle for the first time in Minnesota's game against San Francisco.
The Vikings took over at their own 37-yard line with two timeouts.
"You get thrown in right there, the fourth quarter, 2-minute drill to go win the game, every quarterback dreams of that," Heinicke said. "That's what you go to bed thinking about, going to win the game, and fortunately we did it. I think we executed pretty well, but there's going to be a lot of things that we can look at on film and see how we can do it easier."
After Terrell Newby scored as regulation expired, the Vikings were able to try a 2-point conversion.
The initial call was a screen to the left, but Heinicke saw three white jerseys of 49ers defenders and opted to race the other way. He reached the ball across the goal line and inside the pylon with a diving flip.
"I was trying to make something happen, and fortunately, the guys on the right weren't paying attention, I guess," Heinicke said. "I tried to outflank the d-end and run to the pylon. Fortunately, it happened."
Vikings 32, Niners 31.
To everyone else, it was a wild end to a preseason game, but to Heinicke, it was a version of a dream come true.
For seemingly the first time Sunday night, there was a wall of folks that Heinicke couldn't escape.
Teammates who participated in the play got to him first, and the pile moved Heinicke further across the 49ers sideline to the wall as streaks of Purple zoomed across the field.
"Once I got up, everyone who was on the field was there, and the next thing you know, the whole sideline was pinning me up against the wall," "It was a fun 30 seconds over there, but yeah, see it tomorrow, get better and go from there.
Heinicke missed all of the 2016 preseason and didn't play in the regular season. His first ever pass inside U.S. Bank Stadium skipped off the turf, short-hopping Rodney Adams, but Heinicke bounced back by making plays with his arm and legs.
He converted a fourth-and-2 at the San Francisco 43 with an 8-yard pass to Cayleb Jones and erased a holding penalty with completions to Isaac Fruechte and Adams. The Vikings were helped on a third-and-1 by a 49ers penalty, before Heinicke overcame another Vikings holding infraction.
Heinicke completed passes of 11 and 15 yards to Jones and Stacy Coley, moving the ball to the 5-yard line with 10 seconds remaining. Coley drew a pass interference penalty in the end zone with one second remaining, setting up Newby's score.
Plenty to improve: The ending added excitement, but Head Coach Mike Zimmer and Vikings players talked about the need to continue to improve.
"It was good, the end of the game there to be able to come back from two scores and work some of the situations that we've been working in practice," Vikings Head Coach Mike Zimmer said. "But we didn't play good enough tonight.
"We didn't play well defensively, gave up big plays, had too many mistakes," Zimmer continued. "And then offensively we started out the game with two negative plays, and it kind of kept going from there. Got a lot of work to do, try and get back on track and try to get this thing turned around."
Xavier Rhodes said the Vikings made "a ton of mental errors" and placed blame on himself for San Francisco's first touchdown, a 46-yard pass from Brian Hoyer to Marquise Goodwin.
"I'll go on and say it, me personally, my eyes were on the backfield on the deep post," Rhodes said. "I wasn't playing my man. Stuff like that, as a defense and a player, we have to lock in and play our man instead of playing the play."
The 49ers scored touchdowns on both of their first possessions, netting 167 yards and seven first downs on drives that lasted five and 10 plays.
After that, the first-team defense allowed 21 net yards and one first down the rest of the half.
Defensive end Everson Griffen said "in order to be great, you've got to play great on each and every series."
"You're never going to be perfect. You're going to have games like this in the regular season where you're going to face adversity," Griffen said. "At the end of the day, it's all about us coming together as a unit and starting to execute. It's not about pointing the blame. It's let's come together, strike, get off the ball and make plays."
Offense sputters early: The Vikings first-team offense opened the game with consecutive negative plays, a quick pass from Sam Bradford to Dalvin Cook that lost five yards and a fumbled exchange between Bradford and Cook that lost seven.
Minnesota netted just 82 yards on its first five possessions before driving 52 yards in the final minute of the first half. The Vikings, however, were unable to get points out of that possession because time expired before they could spike the football to stop the clock after a 28-yard pass to Adam Thielen to the San Francisco 6.
"Probably a little bit disappointed in the overall performance," Bradford said. "I thought it was just a little bit sloppy, too many mistakes. I thought we did a decent job getting drives going, getting a first down, getting two first downs, and then it seems like we just do something to shoot ourselves in the foot and stop it.
"To be a good offense, to be a good football team, you can't do those things, and we got to figure out a way to eliminate that and not beat ourselves," Bradford added.
Bradford completed 17 of 21 passes for 134 yards, and two of the incompletions occurred on uncharacteristic drops by Stefon Diggs.
Bradford preseason stats:Bradford is unlikely to play in Minnesota's fourth preseason game on Thursday when the Vikings host the Dolphins.
If he doesn't play, he finished his first preseason 29-of-39 passing (74.4 percent complete) for 264 yards and totaling a passer rating of 92.3.
More PT?: Laquon Treadwell made his 2017 preseason debut on Sunday and had three catches for 36 yards, including a gain of 19 on the Vikings third snap of the game.
"I just enjoyed being out there with my teammates and competing," Treadwell said. "Everything is great, man. I just want to keep going and keep going each and every game and practice."
Asked if he expects to play on Thursday, Treadwell said, "Hopefully I do."
"I want to," Treadwell said. "I'm pretty sure they'll put me out there so I can get in a rhythm with the quarterbacks. I want to keep having fun and seeing live action."