Johnson (4-2) gave up one run on four hits in six innings and struck out nine to move past Roger Clemens for second on the all-time strikeout list.
More importantly, he ensured that Arizona would not get swept for only the second time this year and stopped a three-game losing streak like he has done so many times in his career.
"He's had a history of doing those type of things, and any time he goes out there in that situation you feel good about it," manager Bob Melvin said.
In the process, Johnson won his first game at Chase Field since leaving Arizona after the 2004 season. Johnson has pitched great in his last five outings, running his record to 4-0 with a 1.82 ERA in those games, but the bullpen blew the only one of those starts at home.
"I've pitched some quality games, but I was wondering if I was going to pitch a good enough game to win a ballgame at home," Johnson said. "I like going on the road, but I like sleeping in my own bed and pitching good in front of my home fans. It's just a matter of time."
Johnson knew coming into the game that it would not be easy with Matsuzaka his opponent on the mound. The Japanese import nearly matched Johnson pitch for pitch, giving up two runs on an identical four hits with nine strikeouts.
Carlos Quentin's RBI double in the sixth off Matsuzaka (7-5) put Arizona on top for good.
"I had to throw my best game or at least match zeros with him, and I thought he threw pretty well," Johnson said. "The way Daisuke was pitching, we pecked away and got a run off him, and then got one later in the game in the sixth inning.
"It's definitely a morale booster for this young team to go up against someone of that stature who's getting a lot of publicity that they know that they can battle against that type of pitcher that comes in here."
Johnson threw a season-high 113 pitches in the outing. He tallied 101 pitches through the first five innings, a total that usually leads Melvin to signal for the bullpen. The manager kept him in because Johnson told him he felt good, which was helpful with a bullpen that has been taxed during the three-game losing streak.
"RJ gave us a little bit more than we actually even needed at the time," Melvin said.
In stopping the losing streak, he also helped the D-backs tie San Diego for first place in the National League West after the Mariners swept the Padres this weekend.
The D-backs executed down the stretch, in contrast to uncharacteristically losing two of the three games in the streak because the bullpen faltered and hitters were unable to get timely hits as had been the case in winning 11 of 12 before Thursday.
The bullpen pitched three scoreless innings, and when Mike Timlin threw Carlos Quentin's bunt into right field, Arizona tacked on three in the eighth.
"The way we've been playing we feel good every day we go out there," Melvin said. "Losing in the fashion that we did [Saturday] hurt. We felt like we had a good chance to put that game away. We've been playing very well in close games and we felt like that one stung a little bit. So in that respect to go out there and win the game today was big."
Quentin echoed Johnson's sentiments about the win being a good experience for his fellow young teammates to see what it takes to beat a team like Boston, which has the best record in the Majors.
"The Red Sox are a quality team," Quentin said. "It just showed us that we need to execute when we're going up against a team that has that much firepower as far as the lineup and has quality pitching. We tried to take advantage of every opportunity we had."
Now Johnson, a 20-year veteran, hopes to hammer home to his teammates how to get to the place where the Red Sox are, as the D-backs head to New York to face a streaking Yankees squad with a similar winning mentality.
"It's a learning experience along the way, and it's important that a lot of the young guys on this team see what it takes," he said. "That's why the Red Sox and the Yankees are who they are, because they do the little things, and that's something a lot of these guys in here can learn by."