After making three starts in Triple-A, Rob Whalen was called up by the Braves to fill a spot in a depleted starting rotation, and in the first inning Wednesday the move looked highly questionable.

But after the Pirates batted around in a four-run rude-welcome opening frame, Whalen settled in and worked the next four scoreless innings, earning a win in his debut as the Braves rallied and rolled past Pittsburgh, 8-4, at Turner Field.

“It’s unbelievable,” said Whalen, 22. “Putting us in a hole like I did that first inning was tough, but I was just trying to battle through it. What an amazing job by the offense to come through and pick me up, chipping a way that whole game.”

The Braves scored a run apiece in the second through fourth innings, then took the lead with two runs in the fifth on a Nick Markakis sacrifice fly and Ender Inciarte’s go-ahead single that chased Pirates left-hander Jeff Locke (8-7).

Inciarte and Erick Aybar had three hits apiece and catcher Anthony Recker had two hits and two RBIs for the Braves, who out-hit the Pirates 15-4 and have won five of eight games since a five-game losing streak. Whalen credited Recker with calming him and assuring him, when they were down 4-0, that the Braves would come back and win the game.

“Obviously the game didn’t start how either of us hoped it would, but the end result was exactly what we were looking for,” said Recker, who had seen Whalen pitch but never caught him when both were in the Mets organization. “He did a great job getting through that first inning and then just bearing down and making pitches after that.

“I just told him we were still behind him and we were going to come back and win the game, just keep pitching your butt off and we got ya. And he did that.”

Whalen didn’t allow a hit after the second inning, retired nine of the last 10 batters he faced and was charged with four hits, four runs and four walks with five strikeouts. He also twice hit Starling Marte with pitches.

“Came back out and fought his way through five and picked up the win,” Braves interim manager Brian Snitker said. “He was probably a hit away in the first inning from leaving the ballgame, and then he ended up getting the win. I’d heard he battled, he competes, and he sure did that.

“I’m happy as I can be for him. Those guys battle their way through the minor leagues, and injuries and stuff. Gets traded, and the next thing you know he’s starting a game in Turner Field, and it’s probably a little surreal for him. And to get a win on top of it is really cool.”

The youthful right-hander admitted he was nervous in the first inning, and Whalen also said he was more amped up after the game than it appeared outwardly, as he fielded questions while trying to maintain a cool demeanor. He said he was in the dugout cheering his teammates on when they scored two runs in the fifth to take the lead and two more in the sixth.

“I was on the top row, waving the guys around the bases,” he said, smiling. “I could even see my parents up in the stands going crazy. I could hear them. It was amazing. An unbelievable experience. To watch that happen just was unbelievable.”

Whalen came to the Braves along with fellow pitching prospect John Gant in a July 2015 trade for infielders Kelly Johnson and Juan Uribe.

A 12th-round draft pick by the Mets in 2012 out of Haines City (Fla.) High School, just down the road from Braves spring training, Whalen pitched in the past few seasons for Sand Gnats (Single-A Savannah) and Mudcats (high-A Carolina) and Scorpions (Arizona Fall League) among others. But he’d never worn a major league uniform until Wednesday, and as the first inning dragged on it looked like he might be a while before he wore one again.

With two outs and a runner at second in the first inning, hit hit Marte before giving up a three-run homer to Matt Joyce on an 88-mph cut fastball. David Freese followed with a single. Consecutive walks loaded the bases, A wild pitch to Locke on a two-strike count let in the fourth run. Finally, Whalen got an inning-ending strikeout on his 36th pitch.

When he came out for the second inning, Whalen didn’t have the same wide-eyed nervous look about him. He set down the first two batters of the second inning before Jung Ho Kang’s double, then got Marte on a fly out to end the inning.

Kang’s double was the only Pirates hit in the second through fifth innings, and their only other base runners in that span reached on consecutive walks to start the third inning and another Marte hit-by-pitch leading off the fifth.

The Brave had cut the lead to 4-3 before Freddie Freeman led off the fifth inning with a walk. Matt Kemp followed with a double that landed just in front of center fielder Marte, who made a sliding catch attempt.

It was the first Braves hit for Kemp in his second game since the veteran slugger arrived in a trade from the San Diego Padres, and he added his first RBI on a sacrifice fly in a two-run sixth inning.