Pettitte stopped the Orioles once again, Eduardo Nunez returned from the 60-day disabled list to get a go-ahead hit, and the Yankees beat Baltimore, 5-4, Saturday in New York for their season-high sixth straight win.

Pettitte hung in there on a hot, sticky day after the Orioles took an early 3-0 lead and ending his four-start winless string.

Get Sports Headlines in your inbox:

The Globe's most recent sports headlines delivered to your inbox every morning.

‘‘I've been frustrated,’’ he said. ‘‘Every decision you’re making, you feel like it’s not the right one.’’

Pettitte stretched his unbeaten streak against Baltimore to 11 starts dating to 2007, winning eight times. Overall, he is 28-6 against the Orioles — only Yankees great Whitey Ford (30) has beaten the Birds more often since the franchise moved to Baltimore for the 1954 season.

Pettitte left with two outs in the seventh inning after 100 pitches. Mariano Rivera worked the ninth for his 29th save.

In addition to overcoming Davis’s 33d home run, the Yankees survived yet another double from Manny Machado, his 39th.

‘‘Any time you’re leading early in the game, you expect to continue to lead, or at least put up some more runs,’’ Davis said.

‘‘One- and two-run leads in this game don’t last very long, especially in this ballpark and with their offense,’’ he said.

Royals 4, Athletics 3 — Jarrod Dyson delivered an infield single with the bases loaded and two outs in the eighth inning as host Kansas City beat Oakland.

The Royals had rallied to tie the game on a sacrifice fly by Eric Hosmer in the seventh, and then loaded the bases on an error and a pair of walks by reliever Ryan Cook.

Dyson showed bunt on his first pitch from Cook before hitting a grounder deep behind second base. Shortstop Adam Rosales fielded it cleanly but didn’t even bother with a throw as pinch runner Alcides Escobar scored the go-ahead run.

Brewers 7, Mets 6 — Jonathan Lucroy homered and Yovani Gallardo scattered six hits over six innings while adding two hits and a pair of runs to lead host Milwaukee over New York.