Arizona slugger Paul Goldschmidt hit a game-tying homer off Johnson in the ninth and a game-winning homer off McFarland leading off the 11th as the Diamondbacks beat the Orioles 4-3 at Chase Field.
The Orioles fell to 65-54 and missed a chance to move within a game of Tampa Bay for second place in the AL East and within a game of Tampa for the AL's second wild card berth.
Goldschmidt hit Nos. 28 and 29. The O's took a 3-2 lead to the ninth, but Johnson suffered his eighth blown save of the year and second in the last five games. McFarland, working for the first time since Aug. 3, pitched a scoreless 10th before Goldschmidt homered leading off the 11th.
The Orioles led 3-0 going to the last of the seventh before Arizona scored twice off Miguel Gonzalez.
In the fourth, Chris Davis hit a two-run homer. Davis turned on a 1-0 down-and-in fastball from Randall Delgado to give the O's a 2-0 lead.
Davis broke his tie with Rafael Palmeiro and moved into fourth place on the O's single-season home run list by hitting No. 44. He is now two away from Jim Gentile for third, who hit 46 in 1961.
Davis has hit four homers in the last six games, seven in the last 13 and 22 over his last 50 games. He is on a pace to hit 60 homers.
J.J. Hardy provided the O's a 3-0 lead with a leadoff homer in the fifth. It was No. 22 for Hardy and his fourth in the last six games.
Gonzalez had a second straight strong outing. He took a shutout into the seventh before allowing two runs. He gave up five hits and the two runs over seven, with no walks and three strikeouts.
This was the O's sixth quality start over the last eight games, and the starters' ERA is 2.86 in that stretch.
But it all ended up in a loss as the Orioles fell to 14-20 in one-run games.
The Orioles would complete a 5-3 road trip if they can win Wednesday afternoon at 3:40 p.m. when Chris Tillman (14-3, 3.73 ERA) faces left-hander Patrick Corbin (12-3, 2.36 ERA).