– This time Bruce Boudreau didn’t mind giving up four goals if it meant the Wild scored five.

After trying to tighten things up defensively during five days off this week after seeing signs of decay lately, the Wild opened the floodgates during a wild, four-goal third period Thursday night to shock the San Jose Sharks 5-4.

With the Wild trailing 4-3 after the Wild and Sharks combined for four goals in a 2-minute, 58-second span early in the third, captain Mikko Koivu, playing in his 800th game, scored the tying and eventual winning goals off two beautiful plays.

“I still don’t like the four, but I like the ‘W’ that goes into our column,” Boudreau said.

In an arena that is usually a house of horrors, the Wild avoided consecutive regulation losses for the second time this season and won its seventh in a row on the road.

For the fourth time in five games — and third in a row by Devan Dubnyk — the Wild allowed four goals.

Didn’t matter.

Zach Parise and Eric Staal combined for three-point nights with Parise tying the score off Nino Niederreiter’s rebound 2:08 into the third. But Dubnyk gave up two goals in 32 seconds, the second by Patrick Marleau that continued a string of soft goals against Dubnyk lately.

But just 45 seconds after that, Staal slammed home a Parise rebound to cut the deficit to 4-3.

That’s when the Jason Zucker-Koivu-Mikael Granlund line went to work. Granlund and Zucker each assisted on Koivu’s goals, with Granlund picking up two points for the fifth time in six games and team-leading ninth time this season.

The Wild, which had its franchise-record 12-game winning streak end New Year’s Eve at the hands of the Columbus Blue Jackets, is 8-1-3 in its past 12 road games.

“It felt like every time we stepped on the ice, the score was different,” Parise said. “But, it make it fun. It was a lot of fun to play.”

The Wild was 1-5-1 in its previous seven visits to San Jose and 3-13-2 in its past 18.

The Sharks were all over the Wild in the offensive zone early on, but Dubnyk and the Wild weathered the early frantic pace and survived the first period scoreless.

But things turned from bad to worse in a span of 3:05 around the midway point of the period when Joonas Donskoi and Joe Pavelski scored consecutive goals.

After a poor line change by the Wild and soon after Zucker couldn’t get a shot off on a second Granlund setup in the game, Donskoi was left all alone when Zucker skated toward the puck carrier, Kevin Labanc.

The Wild drew a high-sticking minor, but with 15 seconds left in the power play, Matt Dumba was whistled for holding Logan Couture.

Four seconds into the ensuing 4-on-4, Pavelski beat Erik Haula clean on the faceoff — the first of two times that occurred in the game en route to a San Jose goal — and buried his own rebound after redirecting Brent Burns’ shot initially, then beating Marco Scandella to the net.

But with 1:23 left in the period, Zucker drew a penalty and Staal scored a big goal 22 seconds later. Charlie Coyle carried the puck into the zone, fed Parise, and while falling, Parise gave Staal a perfect drop pass that he wired past Martin Jones from 47 feet away atop the circles.