Canada scored 12 runs in the final three innings to move into Monday's game to decide which nation joins the 2013 WBC field.
Van Ostrand had four hits and scored three runs, Tyson Gillies had a home run, three hits and three runs and Rene Tosini hit a pinch-hit grand slam. Jordan Lennerton also slugged a home run.
Sheldon McDonald came on in relief to pick up the victory, while Adam Loewen and Shawn Bowman both collected three hits.
"A four-hour game, that says it all. What a game," said Canada manager Ernie Whitt. "We threw too many pitchers. When you fall behind, hitters hit the ball. You have to give Germany a lot of credit. The score doesn't indicate how the game was played.
"Our goal coming in was to win three games. We haven't accomplished that yet. We will see who we play on Monday."
On Monday, Canada will take on the winner of Sunday's showdown between Germany and Great Britain.
"It was disappointing to lose this game, but the tournament is not over," said Germany manager Greg Frady. "We have a good team. We didn't play well. We gave up some big hits. Tonight went their way. We have to play a little bit better and catch a little bit better. But you could see that we can hit with this team."
Just like against Great Britain, Canada jumped on the board in the first inning. Alex Burgos, Germany's 21-year-old starter, walked the first two batters before Van Ostrand crushed a three-run home run over the left-field wall for a 3-0 lead.
Germany answered with three runs of their own in the second to even the game at 3-3. With runners on first and second and one out, Eric Suttle singled to right field to score Jake Shaffer, while Matt Weaver came across on Loewen's errant throw to the plate, allowing Suttle to reach second.
Matt Vance also went to the opposite field for a single and Suttle snuck in just ahead of Loewen's throw up the third-base line to make it 3-3.
Van Ostrand led off the third inning and took Burgos deep again to left field for his second homer of the night and third of the tournament to give Canada a 4-3 lead.
Canada catcher Cole Armstrong had to leave the game after three innings with an apparent Achilles tendon injury while running out an inning-ended flyout.
The Germans manufactured a run in the bottom of the frame to even the score at 4-4. Donald Lutz's aggressive baserunning resulted in a leadoff double. Simon Guhring sacrificed him to third and Lutz scored on Shaffer's groundout.
As the temperatures in southern Germany began to drop into the 40s, both teams' bats went cold, as well.
Canada's second pitcher, Jamie Richmond slowed down the Germans with just two hits and one walk over 2 1/3 innings. German reliever Luke Sommer faced the minimum batters in the next 3 1/3 innings after replacing Burgos.
But Gillies snapped that streak with a home run to right center with one out in the seventh. That was the first of seven straight hits, including an RBI triple by Tim Smith and RBI singles by Van Ostrand, Bowman and Robinson for a 9-4 Canada lead.
Germany picked up two runs in the bottom of the seventh on a pinch-hit double by Aaron Altherr and a single by Kai Gronauer to pull within 9-6.
But Canada responded with two more runs on a solo home run by Lennerton and an RBI single by Loewen.
Canada's onslaught continued in the ninth with five runs on five hits, featuring Tosini's grand slam.
Frady was ejected by home plate umpire Will Little for coming out to argue a balk call in the eighth inning.
David Hein is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.