BINGHAMTON – If the final month of the Eastern League season can be like Friday night, it might be about as entertaining as baseball gets. Perhaps not pretty, but entertaining for certain.

The Binghamton Mets trailed by as many as five runs, rallied to tie the score, gave up a pair of runs thanks to a pair of wild pitches and an error on a throw from the catcher back to the pitcher, then eventually won a wild 9-8 game against the Bowie Baysox on a walk-off wild pitch in front of an announced 3,360 at NYSEG Stadium.

Along the way, the teams combined to hit six home runs, the B-Mets moved to within four games of first place Portland in the Eastern Division, Dilson Herrera performed more late-inning magic, and also managed to get a broken bat stuck roughly 20 feet up the netting behind home plate that protects fans.

On Tuesday night, Herrera hit a home run in the eighth and drove in the winning run in the ninth in a walk-off win. Friday night, Herrera tied the game with an RBI triple and then scored the winning run.

“He’s a player that moves this team,” B-Mets manager Pedro Lopez said. “He brings a lot of energy. I think everybody feeds from that. Whenever you have a player like him that is excited to be out there and plays the game the right way, I think everybody else feeds from that.”

Herrera, a 5-foot-10, 150-pound second baseman, overflowed with so much emotion that he started waving a celebratory fist at his teammates in the dugout in celebration before he’d even been called safe after the game-tying RBI triple in the bottom of the ninth.

“It’s amazing,” Herrera said of his reaction. “In that moment, we don’t control the emotions. I was excited.”

One pitch later, Herrera scampered home and scored the winning run with a head-first slide on a wild pitch.

Baysox closer Drake Oliver came into the game with a league-best 23 saves in 26 opportunities. With two outs, Brandon Nimmo smacked a double down the right-field line. Herrera then smoked a triple into the right-center field gap. Herrera gathered himself long enough to be alert when Oliver uncorked a wild pitch past catcher Michael Ohlman.

“I was ready for the first pitch because the he (had) no control of the fastball,” Herrera said. “Pedro said be ready for the first pitch. I was ready.”

Jayce Boyd, Travis Taijeron and Brian Burgamy hit home runs, and Boyd went 3-for-5 with two RBIs. Juan Centeno went 3-for-4 and reached base four times in his first game with the B-Mets this season.

B-Mets starting pitcher Gabriel Ynoa struggled with his command and the Baysox did not let him get away with it. The visitors scored six runs on seven hits, including three home runs, in four innings.

The B-Mets clawed their way back to tie the score after a two-run fourth and a three-run fifth. Boyd’s sixth home run of the season pulled the B-Mets within 6-5 in the fifth, and Brandon Nimmo’s RBI single tied the score four batters later.

Ronald Bermudez scored from third with two outs in the sixth when relief pitcher Hansel Robles couldn’t handle the throw back to the mound from catcher Centeno. Reliever Chase Huchingson, who threw wildly his entire outing, unleashed a pair of wild pitches in the seventh that led to another run and the Baysox’ 8-6 lead.

The B-Mets lineup underwent a shakeup with the addition of a pair of elite defensive players who are both on the Mets 40-man roster and made their major-league debuts in 2013. Centeno, a catcher, and infielder Wilfredo Tovar both joined the B-Mets on Friday.

Centeno had spent the entire season with Triple-A Las Vegas where he batted .291. Tovar began the season with the B-Mets, but tore a ligament in his left thumb and went on the disabled list on May 30. He played two games in the Gulf Coast League and five with Single-A St. Lucie after rehabbing.

Tovar, who played both second base and shortstop while Matt Reynolds was on the roster earlier this season, will get the majority of the playing time at shortstop. In 47 games with the B-Mets before his injury, Tovar batted .313 with 21 RBIs and a .377 on-base percentage.

Centeno now becomes the team’s primary catcher. In order to make room for Centeno and Tovar, catcher Kai Gronauer and infielder Rylan Sandoval were placed on the disabled list.