John Ryan Murphy tacked on a two-run base hit as part of a four-run third inning. The Yankees added three more in the fourth for a 7-0 lead.
That was plenty of offense to support Hiroki Kuroda (4-3), who notched his first road win since July 25, 2013 at Texas. Kuroda scattered nine hits and gave up three runs in 5 2/3 innings to help the Yankees win for the fourth time in five games.
New York used four relievers to hold down the Cardinals.
Shelby Miller (6-4) was pounded for nine hits and seven runs in five innings to lose his second straight start.
Kolten Wong set a career-high with four hits and drove in a run, but the Cardinals couldn't build on a 6-0 win Tuesday when Lance Lynn threw his first career complete game.
The Cardinals actually had the tying run at the plate with nobody out in the ninth after Allen Craig singled and Yadier Molina walked, but David Robertson struck out the next three hitters to end the game.
Ellsbury's line hit to right-center field plated Brett Gardner for the first run. The Yankees then filled the bases before Murphy lined a single to right- center. Ichiro Suzuki followed with an RBI fielder's choice.
Kuroda avoided trouble in the bottom of the third. He gave up a pair of singles and then hit Craig to fill the bases, but Molina popped out to cap the inning.
Ellsbury's base hit to center plated two more in the fourth. He stole second and scored on Brian McCann's single to right.
Daniel Descalso grounder to left field scored Jon Jay in the bottom of the fourth and Wong came home on Craig's groundout in the fifth for a 7-2 margin.
Peter Bourjos flied out to right to strand a runner at third in the home seventh.
Randy Choate got a double-play ball to avoid a bases-loaded jam in the top of the eighth, and Wong made it a three-run differential in the bottom portion with a single that scored Carpenter.