Williams hit a pair of two-run homers, helping Johnson win for the first time in a month and leading the Yankees over the Kansas City Royals 5-1.
Alex Rodriguez also homered, helping the Yankees beat the Royals for the first time this season. New York lost all three games at Kansas City from May 31-June 2 in Buddy Bell's first series as Royals manager, part of a season-high six-game losing streak.
"We are making our push," Williams said. "We are obviously trying to catch up for the shaky start we had."
Johnson (12-8) allowed four hits and struck out six in eight innings. He had been 0-2 with a 6.49 ERA in four starts since beating Minnesota in the Yankees' 4-0 victory on July 26.
"That was as good as I've seen him, just in the attack mode," Yankees manager Joe Torre said.
The Big Unit blamed poor mechanics for his somewhat disappointing first season in New York. But he sorted some things out while throwing off a mound after his last start -- he usually works off flat ground between outing -- and the results showed Friday.
"It's been a mechanics thing all year long and will continue to be so," he said. "It all comes down to mechanics and that's one reason I've been inconsistent with my velocity."
Williams hit his 11th homer in the sixth, two batters after Rodriguez homered. He added another drive in the eighth for his first multihomer game since Sept. 13, 2003, against Tampa Bay. Williams has driven in 17 runs in his last 14 games.
"I think Bernie is motivated by the game situation, the time of year," Torre said. "He just seems to perform well."
Mariano Rivera finished the six-hitter. New York (71-56) moved 15 games over .500 for the first time this season and remained tied with Oakland (71-56) for the AL wild card lead, less than one percentage point in front of Cleveland (72-57).
Mike Wood (4-5), the winning pitcher last Saturday when Kansas City beat Oakland to snap its 19-game losing streak, allowed three runs and seven hits in six innings. The Royals had followed their skid by winning four of five, but Friday's loss dropped them to 0-9 at Yankee Stadium since Aug. 6, 2002.
"Their big guy was pretty good tonight. Great stuff, pretty good location to go along with it," Bell said. "Facing a guy like that, you've got to take advantage of any situations you've got. We didn't get any tonight."
Johnson gave up four homers in an inning for the first time in his career on Sunday in a loss at Chicago. The only homers Friday were ones that helped him.
Rodriguez drove the first pitch he saw in the sixth in the center-field bleachers for his league-leading 38th homer. He joined Williams and former Yankee Danny Tartabull as the only players with three home runs into the black batter's eye since the remodeled stadium reopened in 1976.
Jason Giambi then walked for the third time and Williams hit the next pitch to right, giving the Yankees a 3-0 lead and earning a curtain call. He got another one after his eighth-inning drive.
Mike Sweeney doubled to open the seventh and scored on Angel Berroa's one-out single for Kansas City's lone run.
Wood pitched out of trouble twice to keep the game tied until the sixth. He escaped a bases-loaded jam in the first by getting Williams to ground out. The Yankees put runners on the corners with one out in the fourth, but third baseman Mark Teahen made a diving stop of John Flaherty's smash and started a double play.
- OF Gary Sheffield had the appeal of his two-game suspension for throwing his helmet during a game against the Mets on June 26 heard Friday by MLB executive vice president John McHale Jr. With the troubles of his uncle, Dwight Gooden, weighing on his mind, Sheffield doesn't want to sit out, because playing helps take his mind off things. "This is my safety net," he said. "This is what I know."
- RHP Wood was the only starter not to lose during Kansas City's losing streak. He had no-decisions in two starts before the victory over Oakland.