Three. It’s a magic number.

That lesson from Schoolhouse Rock often applies on the hockey rink as well, where the first team to get three goals is often the winner. And it was a hard lesson for the Minnesota Wild to re-learn on Tuesday.

With the Wild up by two early, Detroit got a pair of quick goals in the middle period, then defenseman Simon Edvinsson’s seeing-eye shot through traffic was the eventual game-winner in Detroit’s 3-2 victory.

After Minnesota had won on the Red Wings’ home rink on Saturday, the teams split their season series. Edvinsson turned in his first two-goal game of the season for Detroit.

Marco Rossi and Jakub Lauko scored first-period goals for Minnesota, which has been a .500 team at Xcel Energy Center this season while sporting the NHL’s best road record. The Wild had won two in a row at home prior to the 4 Nations Face-Off break, but fell to 13-13-1 at home.

“I think it’s a disappointing loss from the sense that I thought we played a really solid game. I thought we carried play,” Wild coach John Hynes said. “They found a way to get a couple more goals than we did. But I think the style of game that we played, the structure we played with, the offensive attack that we had, we did lots of good things tonight. But sometimes that’s how it goes.”

The Wild got 13 saves from Filip Gustavsson, as he fell to 22-13-3 on this season.

For the Red Wings, they mounted a furious comeback after falling behind. Goalie Cam Talbot had 22 saves for Detroit, which has been one of the Eastern Conference’s hottest teams following a coaching change. They are making a push for their first playoff berth since 2016.

Minnesota saw its three-game win streak snapped.

After winning despite playing from behind in their final game before the 4 Nations break, and in their first game back in action on Saturday, the Wild took a different approach on Tuesday, jumping out to a 2-0 lead via strong special teams and opportunistic offense.

Detroit missed a golden opportunity to take the crowd out of the game early when Marco Kasper clanked the right goalpost behind Gustavsson, and the Wings had an early lead in shots. Then they took a penalty for delay of game, and the Wild pounced.

On the ensuing man advantage, Matt Boldy got a long shot through to Talbot, who made a pad save but couldn’t control the rebound. Rossi, posted just outside the crease, got two whacks at the puck and slid the second one over the line, extending his goal-scoring streak to three games.

“Tough building. We knew that the start was going to be key, and obviously we didn’t get the start that we wanted,” said Talbot, who played 82 regular-season games in a Wild uniform earlier in his career. “But ... give our guys a ton of credit for battling back. Could be easy to fold after that, but we battled back. We knew what we’ve got in this room, and we settled down and got back to our game and ultimately got the big win.”

In the opposite crease, Gustavsson had a stellar first period with 10 saves, two on point-blank attempts.

Minnesota came within inches of extending its lead on a power play early in the second, but Talbot denied Vinnie Hinostroza on the doorstep.

And then in what seemed like the blink of an eye, although in reality it took three minutes, Detroit tied the game on goals by Vladimir Tarasenko and Edvinsson. The latter came via a bomb of a slap shot from the blue line that fooled Gustavsson. After the game, the goalie took the blame for a costly soft goal.

“I don’t think we played bad today,” Gustavsson said. “It’s just games right now get tight at this time of year, and sometimes one bad goal like that can determine the game.”

Lauko, who has had an injury-plagued season and was back in the lineup after missing three games, doubled the lead with a soft shot that slipped between Talbot’s skates. It was the third goal for Lauko, who has missed 24 games due to injury.

One leftover from the first game of this two-game home-and-home series versus the Red Wings was Detroit announcing that center Andrew Copp was out for the season, and likely to miss four to six months after having surgery to repair a torn pectoral tendon.

The Wild close out February in the mountains, visiting Utah on Thursday and Colorado on Friday.