Blue Jays outfielder Randal Grichuk celebrated his 28th birthday with a solo home run as Toronto won for the fifth time in seven games.
Texas has lost six of seven, a stretch in which the Rangers have been shut out twice and scored more than three runs just once.
Hernandez and McKinney connected off right-hander Shawn Kelley in the sixth. It was the 11th time this season the Blue Jays have hit back-to-back home runs, matching the 1999 team record.
Right-hander Wilmer Font opened for Toronto, his third such assignment in the past seven games.
Font struck out two and allowed one hit in two innings before making way for left-hander Thomas Pannone (3-5), who worked four shutout innings.
Giles, who has been bothered by a sore elbow, pitched for the first time since Aug. 7 at Tampa Bay, when he allowed three hits and two runs in one inning but still earned the save in a 4-3 victory.
Rangers right-hander Lance Lynn (14-8) allowed one run and four hits in five innings, his shortest outing since going 3 1/3 innings at Oakland on April 23. Lynn matched a season high by walking three and struck out six.
Lynn was not beaten in consecutive starts over his first 19 appearances but has lost back-to-back outings twice in his past six starts.
Grichuk opened the scoring by homering off Lynn to begin the second, his 22nd of the year and second in two games.
The Blue Jays loaded the bases with one out in the fourth but couldn't add to their lead. Brandon Drury popped out and Rangers center fielder Delino DeShields made a great catch on Reese McGuire's drive to the warning track. DeShields fell back into the wall after making the play, banging his head and neck at the base of the fence. He stayed down for several moments and received attention from the trainer before getting up to a round of applause and walking off unassisted.
DeShields remained in the game.
Blue Jays: Toronto recalled 1B Rodwy Tellez from Triple-A Buffalo and optioned RHP Brock Stewart to Triple-A. Stewart pitched 5 1/3 innings of relief Monday, earning his second win of the season.
Rangers: LHP Kolby Allard (0-0, 4.15) will make his second start of the season in Wednesday afternoon's series finale. Allard struck out a career-high seven in his previous start, Aug. 9 at Milwaukee.
Blue Jays: RHP Sean Reid-Foley (2-2, 2.36) has allowed two earned runs over 14 innings since rejoining the rotation July 30.