Matheny was arguing with Lentz when he came out to relieve Matt Bowman after Buster Posey drew a walk on a close 3-2 pitch. After handing the ball to reliever Kevin Siegrist, Matheny started yelling at Lentz as he walked toward the dugout and was quickly ejected.
It's the second ejection of the year for Matheny and the third for the Cardinals. Lentz, filling in for Phil Cuzzi on Tom Hallion's crew, administered his first ejection of the year.
It was Matheny's 14th ejection as a manager.
At the time of the ejection, San Francisco owned a 3-2 lead, scoring all its runs in the seventh.