Ortiz's homer was No. 526 of his career, bringing him within eight of Jimmie Foxx for 18th place on the all-time list. It was the 40-year-old slugger's 994th extra-base hit with the Red Sox.
Peavy, making his first start at Fenway since Boston traded him to San Francisco on July 26, 2014, lasted six innings, allowing four runs on three hits and a walk with six strikeouts.
Peavy (5-8) was a member of the Red Sox's 2013 World Series championship team and the Giants' 2014 World Series championship squad. He received a standing ovation from the Fenway faithful while throwing his second-inning warm-up pitches.
Brock Holt added a solo homer for Boston, which is a season-high-tying 13 games above .500. The Red Sox (52-39) won their fifth consecutive home game and improved to 10-3 in the month of July.
Blue Jays 5, Diamondbacks 1
PHOENIX -- Edwin Encarnacion hit a three-run homer, and Aaron Sanchez won his American League-high ninth consecutive decision in Toronto's interleague victory over Arizona at Chase Field.
Encarnacion hit his 25th homer of the season with two outs in the third inning to give the Blue Jays a 3-1 lead in support of Sanchez, who has not lost in his last 15 starts.
Josh Donaldson added three hits and an RBI, and Devon Travis had two hits, scored twice and drove in a run as the Blue Jays (53-42) won for the 10th time in 14 games.
Pirates 3, Brewers 2
PITTSBURGH -- Josh Harrison tripled in the bottom of the ninth inning and scored on the play after second baseman Scooter Gennett's throwing error as Pittsburgh rallied to beat Milwaukee.
Harrison drove the second pitch by reliever Tyler Thornburg (3-4) off the top of the wall in right-center field as center fielder Kirk Nieuwhenhuis failed to make a leaping catch, then kept on going as Gennett's throw sailed wide of third.
Pirates closer Mark Melancon (1-1) got the win but blew a save opportunity for the second time in as many games -- he's 27 of 30 -- when, with Milwaukee down to its final strike in the top of the inning, Hernan Perez singled to make it 2-all in the ninth. Ryan Braun walked to start the inning and Jonathan Lucroy singled.
Twins 6, Tigers 2
DETROIT -- Tommy Milone took a shutout into the ninth inning while winning his third consecutive start, and Eduardo Nunez drove in three runs as Minnesota held off Detroit at Comerica Park.
Milone (3-2) allowed two runs on four hits over 8 1/3 innings in Minnesota's first victory over the Tigers in eight meetings this season. James McCann's third-inning single was the only hit he gave up until the ninth. Milone walked two and struck out four.
Yankees 7, Orioles 1
NEW YORK -- Starlin Castro drove in four runs and New York moved over the .500 mark for the first time in over three weeks with a victory over Baltimore.
Castro had his second game with at least four RBI and homered for the first time in 22 games since June 22.
The second baseman began his big night with a second-deck, two-run home run in the second inning off Vance Worley (2-1) and padded New York's lead with a two-run double in the sixth off Odrisamer Despaigne.
Dodgers 8, Nationals 4
WASHINGTON -- Chase Utley had three hits and three RBIs, including a leadoff homer, and crafty left-hander Scott Kazmir gave up just one run and four hits in seven innings as Los Angeles beat Washington.
Utley had an RBI single in the eighth inning off reliever Blake Treinen to boost the lead to 7-1. But Washington's Trea Turner had a two-run triple in the bottom of the eighth off Chris Hatcher to make it 7-3 before left-hander Adam Liberatore came on to pitch for the Dodgers.
Mets 2, Cubs 1
CHICAGO -- Rene Rivera singled in a go-ahead run in the top of the ninth inning as New York held on to beat Chicago.
Rivera, who went 3-for-4, laced a two-out single to right off Cubs closer Hector Rondon to score Neil Walker from second base to give the Mets their first lead of the night.
New York closer Jeurys Familia then pitched a shaky but ultimately successful ninth despite loading the bases. He was rescued by a play at the plate that prevented Addison Russell from scoring a tying run followed by a game-ending double play that snuffed out a potential walk-off rally to collect his 33rd save.
Indians 7, Royals 3
KANSAS CITY, Mo. -- Danny Salazar pitched effectively into the seventh inning, and Mike Napoli and Francisco Lindor homered as Cleveland defeated Kansas City.
Salazar (11-3) gave up three runs, two earned, on eight hits and a walk in 6 1/3 innings. He struck out seven.
Salazar is 3-0 with a 1.21 ERA in three starts this season against the World Series champion Royals, having allowed 15 hits while striking out 25 in 22 1/3 innings.
Marlins 2, Phillies 1 (10 innings)
PHILADELPHIA -- Christian Yelich, who homered earlier in the game, drove in the decisive run with a single in the top of the 10th inning as Miami beat Philadelphia.
It was Miami's second extra-inning victory over the Phillies in as many days. The Marlins won 3-2 in 11 innings on Monday night.
Mike Dunn (2-1) picked up the victory by pitching a scoreless inning in relief for Miami, which won for the seventh time in eight games to maintain a one-game lead in the race for the National League's second wild-card berth.
Braves 5, Reds 4 (11 innings)
CINCINNATI -- Atlanta and Cincinnati both reside in last place in their respective divisions and are in full rebuilding mode.
So, while an 11-inning, three-hour, 38-minute marathon resulted in a win for the Braves, both clubs came away feeling good about a few young pitchers who will factor heavily in their future plans.
Ender Inciarte's sacrifice fly in the 11th inning drove home Nick Markakis with the go-ahead run, lifting Atlanta over Cincinnati at steamy Great American Ball Park.
White Sox 6, Mariners 1
SEATTLE -- Melky Cabrera broke a 1-1 tie with a leadoff home run in the seventh inning and Todd Frazier added a two-run shot in the ninth as Chicago snapped a five-game losing streak with a win over Seattle.
Cabrera and shortstop Brett Lawrie each hit a solo homer, and J.B. Shuck's RBI single in the seventh gave Chicago (46-47) a 3-1 lead before Frazier broke the game open with his 27th home run of the season and his second of the series.
Frazier's two-run shot off Seattle reliever Joaquin Benoit opened a 5-1 lead after Chicago closer David Robertson, who gave up the game-winning homer on Monday night, had started warming up in the bullpen. Robertson sat back down after the Frazier homer.
Angels 8, Rangers 6
ANAHEIM, Calif. -- Albert Pujols went 3-for-3 with a pair of three-run homers to lift suddenly hot Los Angeles to a win over Texas at Angel Stadium.
Though still 10 games under .500 and battling with the Oakland A's to stay out of last place in the American League West, the Angels have won a season-best five games in a row coming out of the All-Star break.
Pujols continued his assault on the record book, his two homers Tuesday -- Nos. 18 and 19 on the season -- giving him 579 for his career and moving him within four of Mark McGwire for 10th on the all-time list.
Rays 10, Rockies 1
DENVER -- Blake Snell dominated Colorado in his Coors Field debut and Tampa Bay scored five runs in the third inning on its way to a win.
Evan Longoria hit a mammoth two-run homer in the third-inning uprising when the Rays batted around, pounded out four extra-base hits and scored five runs as Tampa Bay took a 6-0 lead.
The victory ended the Rays' 11-game losing streak on the road, the third longest in franchise history. The win was just the fifth in their past 30 games for the Rays, who will try to win consecutive games for the first time since June 14-15 in the rubber game of the series Wednesday.
A's 4, Astros 3 (10 innings)
OAKLAND, Calif. -- Josh Reddick hit a walk-off infield single with two outs in the bottom of the 10th, lifting Oakland past Houston.
Pat Neshek (2-2) gave up a two-out single to Marcus Semien in the 10th and was replaced by left-hander Tony Sipp. Semien stole second base, and Sipp walked Yonder Alonso, bringing the left-handed-hitting Reddick to the plate. Reddick hit a ground ball that shortstop Carlos Correa fielded deep the hole as Semien raced around third and headed home. Correa's off-balance throw was late, and Semien scored the game-winning run.
The Astros took a 3-2 lead into the bottom of the ninth with closer Will Harris on the mound. Harris was a perfect 9-for-9 in save opportunities, but the A's pulled even Stephen Vogt and Coco Crisp hit back-to-back doubles with one out.
Padres-Cardinals (rained out)
ST. LOUIS -- Once a heavy thunderstorm finally reached Busch Stadium, Tuesday night's scheduled game between San Diego and St. Louis didn't stand a chance.
Delayed before the start, the game was finally called after a wait of an hour and 32 minutes due to rain, and it was rescheduled as the day portion of a day-night doubleheader Wednesday.
Carlos Martinez (8-6, 2.85 ERA) is expected to work the opener for St. Louis against Colin Rea (5-3, 4.95). In the nightcap, the Cardinals will pitch left-hander Jaime Garcia (6-6, 4.11) against Paul Clemens (1-0, 4.73).
The Cardinals (48-44) opted not to start the game as planned Tuesday when the storm was detected less than 30 minutes before the scheduled first pitch. Neither Martinez or Rea even started his warmups, and the field was covered shortly after the national anthem.