Adam Jones shoves a pie into Nick Hundley’s face after Hundley delivered an RBI single to lift Baltimore to a 3-2, 10-inning win over the Yankees. (Joy R. Absalon/Usa Today Sports)

Asked about the Baltimore Orioles’ recent success in extra innings, Manager Buck Showalter flipped the question Friday night. “If we’re that good, we’d do it before the extra innings,” he said.

The Orioles may just save their best for late. With their 3-2 win over the Yankees in 10 innings, the Orioles (51-41) have won nine of 12 games that have gone into extras, including their past four.

After Baltimore reliever T.J. McFarland forced three groundouts in the top of the 10th, third baseman Manny Machado led off the bottom of the inning with a double. With one out, catcher Nick Hundley hit a liner to shallow center to score Machado.

“I was excited watching the game in the 10th inning,” Orioles starter Miguel Gonzalez said.

The Orioles have won eight of their past 10 games and remained three games ahead of Toronto atop the AL East standings.

The Yankees led 2-0 in the fourth and were threatening to break the game open with Brian McCann on third and Ichiro Suzuki on second with one out. But the opportunity was squandered when third baseman Yangervis Solarte’s flyball to center was too shallow to score McCann and Kelly Johnson flied out to right, ending the inning.

The Orioles capitalized in the bottom of the inning. Designated hitter Steve Pearce was hit by a pitch from right-hander Hiroki Kuroda to start the inning, then a single by center fielder Adam Jones moved Pearce to third.

Injuries have taken a toll on the Yankees’ pitching staff, with four-fifths of their opening day rotation — CC Sabathia, Michael Pineda, Ivan Nova and, most recently, Masahiro Tanaka — out until at least August. The one pitcher from their initial rotation, Kuroda, struggled with his control against the Orioles, throwing three wild pitches and hitting two batters.

A wild pitch sent Pearce home in the fourth, then first baseman Chris Davis’s sacrifice fly to left brought Jones home to tie it at 2.

As Kuroda started to falter, Gonzalez started to settle in. The right-hander pitched eight innings, allowing just a pair of solo home runs overall and no hits after the fourth inning. The first solo homer was hit by Brian Roberts in the second inning. It was Roberts’s first trip back to Baltimore in another uniform after spending the first 13 seasons of his career as an Oriole.

“We know they’re a very talented team,” Hundley said. “We’re going to have to play well to beat them, and fortunately, we did that tonight.”