After the Giants overcame a three-run deficit to tie the contest in the top of the ninth, the Mets came right back in the bottom of the frame, putting two one with one out against Clay Hensley (1-1).
Jeremy Affeldt relieved and surrendered a pinch-hit infield single to Justin Turner, loading the bases. Kirk Niewenhuls then bounced a grounder to second baseman Aubrey Huff, whose throw home forced out Scott Hairston at the plate.
But Posey's relay to first on the double-play attempt sailed into right field, allowing Tejada to come across with the game-winner as the Mets broke a three-game losing streak.
Jon Rauch (2-0) got the victory despite yielding a game-tying, two-run double to Brandon Belt with two outs in the top of the ninth.
Pablo Sandoval went 1-for-4 to stretch his season-opening hitting streak to 14 games for San Francisco.