We know that Gallardo likes to live on the outside corners, and the strikezone plot of his pitches shows that this was especially the case against Pittsburgh. Keep in mind that the plots from Brooks Baseball are from the perspective of the catcher.
Against the Pirates, he seldom went inside against right-handed hitters, and went in on left-handers even less. This offers a stark contrast to his plan of attack against the Cardinals. In his near-no-hitter, Gallardo worked in more often against both lefties and righties, keeping them guessing.
It's not crazy to think that this contributed to his success against St. Louis. The Cardinals looked off-balance for much of the game, and much of that was due to Gallardo mixing up both speed and location. They're a team that has hit Gallardo well throughout his career, and he had them looking confused.
Gallardo pitched fine on Friday going back to his old ways of living on the outside, but the Pirates are also a team he's owned in the past. In the long run, he'd probably be better served working in more often, and he has the stuff to do so successfully. As some scouts have said, it's just a matter of trusting himself to locate the pitches and trusting his stuff to get hitters out.