Jon Jay started it with a two-out single and went to third on a Carpenter double. With first base open, Pirates manager Clint Hurdle elected to walk Holliday to load the bases.
Adams made the Pirates pay by beating the shift with a single down the left-field line to score Jay.
"These guys always want to be up in those situations," Cardinals manager Mike Matheny said. "Especially when they put a guy on base in front of you, I think it's a little extra special. We needed something to happen. He made it happen."
Adams said going the other way has been a focus of his.
"I worked on it a little bit in the offseason, knowing I had to get better at driving the ball that way," Adams said. "Before the Phillies series, I got with the hitting coaches and made some adjustments where I was able to stay through the ball better on the ball away."
Matheny liked Adams' approach.
"That was a real nice swing," Matheny said. "Just nice and short, and he's strong. The ball finds the barrel, it's going to jump a little bit."
Adams' hot streak, which started against the Phillies, has carried over into the Pirates series. Adams nine hits in his last 18 at-bats, with a home run and seven RBIs during that span.
The first baseman's batting average has climbed 65 points to .297 in the last four games.
"It's a good [situation] to be in," Adams said. "You get focused and that's what you prepare for, to come up in big situations and get big hits."
It was the second walk-off hit of Adams' career. The other, a home run, also came against the Pirates on July 7, 2014.
Adams, a western Pennsylvania native, is not making too many friends back home with his performances against the Bucs.
"All my buddies will joke with me at first, mad, saying they're mad because the Pirates lost, but they're happy that I did good," Adams said. "That's probably what I'll get tonight whenever I get home."
Joe Harris is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.