With one out and a 1-1 count on Martin Prado, Yankees manager Joe Girardi put Headley in motion at first base, but Orioles pitcher Bud Norris threw a fastball too far inside for Prado to attempt a swing.
Hung up in a rundown, Headley drew a throw between first and second base, giving Beltran time to bolt from third base. First baseman Steve Pearce threw to third baseman Manny Machado, whose throw home struck Beltran in the helmet as the run scored.
"I just was trying to time the perfect time to go to home and hopefully make it safe," Beltran said. "It worked pretty good for us, but that wasn't the plan."
"There's a runner at third with two outs; you're usually waiting until the ball gets in the first baseman's hand and move him back that way," Orioles manager Buck Showalter said. "It was a little unexpected to see them try it with one out."
The ball shot to the screen behind home plate, where Norris fielded it. His underhand flip sailed wide of catcher Caleb Joseph, who was not looking, and rolled in foul territory along the third-base line.
That gave Headley a chance to race to the plate; Machado rushed for the ball, and the throw home tipped Norris' glove as Headley slid home safely.
"Just a funky play," Headley said. "If [Prado] swings at it, he's not putting it in play anyway. I was going to be out, so I figured, let's make them execute a couple throws at least. It got crazy there.
"Those things don't happen very often in the big leagues, but you put a little bit of pressure on them and sometimes they do. It obviously worked out in our favor that time."
Beltran was credited with a steal of home plate and Headley was credited with a steal of second base, while Machado was charged with a throwing error and Norris a fielding error on the play, which gave the Yankees a 3-1 lead at the time.
"We feel confident, of course, scoring those two runs right there," Beltran said. "By the end of the day, we've got to score more. Our pitching has been giving us an opportunity, and right now we just need to find a way to score a little bit more."