Petit, who has split his duties this season between starting and pitching out of the bullpen, retired the first eight batters he faced to break Mark Buehrle's MLB record with 46 consecutive outs.
Petit (4-3) improved to 2-2 as a starter after allowing just one run on four hits over six innings of work. Petit also struck out nine before leaving with just 81 pitches.
Petit tied the National League record for consecutive batters retired of 41 with a 1-2-3 first.
Pablo Sandoval led off the second inning with a single and after Hunter Pence popped up in the infield, Blanco crushed a Jordan Lyles offering into McCovey Cove to make it 2-0.
Petit fanned Jackson Williams swinging to open the third inning and match Buehrle's mark. Another strikeout, Petit's fourth straight going back to the second inning, to Charlie Culberson gave him the record.
Lyles broke up the historic streak one batter later when he laced a double to the wall in left. Charlie Blackmon then blooped a single to left, and Lyles made an impressive slide to get under Blanco's throw home to put the Rockies on the board.
Pence added a sacrifice fly in the home sixth, and Andrew Susac plated Sandoval in the eighth with a single to left to make it 4-1.
Lyles (6-2) was charged with three runs on four hits over six innings.
Santiago Casilla walked the leadoff batter in the ninth inning but retired the next three he faced to earn his 12th save of the year.