Miller (1-0) struck out four and allowed just one earned run. Recently promoted from the minors, he earned his first AL victory since 2007 with Detroit.
The Pirates tied a season high with four errors, preventing them from moving three games above .500 this late in the season for the first time in 12 years.
Adrian Gonzalez had two hits for Boston and raised his batting average to .361, tops in the majors. Yet the Red Sox won by doing the little things, scoring their four runs on a Pittsburgh error, a pair of sacrifice flies and an RBI groundout.
Both teams had starting outfielders leave in the early innings. Pittsburgh left fielder Jose Tabata was taken off the field on a stretcher after injuring his left quadriceps beating out an infield single in the first. Boston right fielder J.D. Drew exited in the second because of a bruise to his left eye sustained during batting practice.
Jonathan Papelbon pitched the ninth for his 14th save in 15 chances.
Tim Wood (0-2) took the loss in relief as Pittsburgh's normally reliable bullpen showed signs of stress following a busy week.
The Pirates came in looking for an unlikely sweep over one of baseball's top teams. They posted a pair of electric victories on Friday and Saturday, but couldn't make it three straight at packed PNC Park, which set an attendance record for the second game in a row.
Boston hitters stumbled a bit during the slide, scoring just 10 runs. The bats didn't necessarily erupt Sunday — baseball's top-hitting team managed just six hits — but they didn't have to thanks to some uncharacteristically shoddy Pittsburgh fielding. Only one of Boston's four runs was earned.
After a day off, the red Sox head into a much-anticipated three-game showdown at NL East-leading Philadelphia starting on Tuesday night.
The game was two-all when Boston scored twice in the seventh.
Boston broke it open in the seventh. Marco Scutaro drew a leadoff walk and pinch-hitter David Ortiz also walked after narrowly missing a two-run homer when his just-foul drive to deep right field sailed over the bleachers and onto a sidewalk that borders the Allegheny River.
Jacoby Ellsbury put down a sacrifice bunt and was safe when reliever Daniel Moskos didn't field the ball cleanly for an error, allowing the Red Sox to load the bases with no outs.
Dustin Pedroia put Boston ahead with an RBI grounder. Ortiz added an insurance run when he brushed past Pittsburgh catcher Eric Fryer — making his first major league start — on a sacrifice fly by Kevin Youkilis.
Pittsburgh starter James McDonald pitched effectively after moving up a spot in the rotation so the Pirates could give Charlie Morton's tired right arm a breather.
McDonald held the Red Sox to five hits over six innings, giving up two unearned run. The Red Sox scored in the fourth on center fielder Andrew McCutchen's error, with his throw bouncing off third baseman Chase d'Arnaud's glove into the stands.
McDonald had only himself to blame for Boston's second run. He threw wide of second base trying to force out Youkilis on a bunt by Boston's Darnell McDonald — the McDonald's are cousins. The ball rolled into center as Youkilis raced to third. He later scored on a sacrifice fly by Josh Reddick.
Boston's defense wasn't much better but the Pirates couldn't take advantage. They ran themselves out of a potential big inning in the fifth when Garrett Jones overran third base on an RBI single by McCutchen and Miller escaped a bases-loaded, no-out jam by allowing just one run.
Notes:
Pedroia extended his hitting streak to 11 games with a single in the first. … Pittsburgh 3B Pedro Alvarez is expected to get back on the field this week in Florida for the first time since being placed on the 15-day disabled list with a quadriceps injury last month … Boston reliever Bobby Jenks pitched a scoreless inning while making a minor league start for Double-A Portland on Saturday night. Jenks, out since June 8 with a back injury, is expected to be with the Red Sox on Tuesday in Philadelphia.