Hernandez (9-5) allowed two runs on four hits and struck out four to boost the Mariners to their sixth win in their last nine games and improve his record to 5-0 in his last eight starts.
Kyle Seager and Michael Saunders both went 2-for-4 with an RBI apiece for the Mariners. Saunders hit a solo home run in the first inning.
Freddy Garcia (4-4) allowed three runs on five hits and struck out eight and retired the last 15 batters he faced.
The Yankees lost for the fifth time in their last six games -- and also lost third baseman Alex Rodriguez to an injury. Rodriguez is headed for the disabled list with a fracture to his left hand, sustained when Hernandez hit him with a pitch in the eighth inning.