Cole (7-7) allowed just three hits and a pair of walks while striking out nine in the dominating start, tossing 64-of-92 pitches for strikes.
Tony Watson tossed a scoreless eighth and Mark Melancon notched his 12th save for the Pirates, who with their 82nd win broke a 20-year stretch of losing seasons.
The victory also snapped a four-game skid and gave Pittsburgh sole possession of second place in the National League Central, one game behind idle St. Louis.
Pedro Alvarez provided the Bucs' only run with a seventh-inning RBI double.
Texas starter Yu Darvish (12-8) absorbed the hard-luck loss, yielding just the one run on four hits over seven innings. He walked one and struck out six.
The Rangers, who hold the first American League wild card position, dropped the opener a three-game interleague series.
Senate Democrats to pull all-nighter on climate change
Scarlett Johansson steps out with fiance after pregnancy reveal