Locke (3-1) ran his scoreless innings streak to 13 with the performance, during which he shut the Cardinals down on three hits. The left-hander issued two walks and fanned four.
Martin connected for a solo blast in the second inning and a two-run shot in the ninth, giving him three homers in two games.
St. Louis starter Shelby Miller (3-2) was reached for three runs on seven hits in a 5 2/3-inning effort.
'How to Train Your Dragon 2' releases 5-minute clip
Moore to attend retreat in to avoid Kutcher's wedding