Stairs, hitting for Ernesto Frieri in the eighth inning, smashed a pitch off Milwaukee Brewers reliever Kameron Loe over the right field fence to move past Cliff Johnson, with whom he had shared the previous record of 20 pinch-hit home runs.
"It's a great accomplishment, it really is, for a couple reasons," San Diego manager Bud Black told reporters. "Matt has maintained a level of play for a long time. Also, one of the hardest roles on a team is the pinch-hitter."
The two-run blast, however, was not enough to help his team to victory. Milwaukee held on for the 6-5 win.
Stairs, who broke into the majors in 1992 and played for 12 teams, has hit 262 home runs.
(Reporting by Mike Mouat in Windsor, Ontario; Editing by Greg Stutchbury)