Beltran hit a two-run, first-inning double and his RBI double in the fifth snapped a 3-3 tie.
Wright hit an RBI groundout in the first and a two-run double in the fifth.
Ramon Castro had two hits and two RBI.
Winner Johan Santana (5-2) surrendered six runs -- four earned -- and 11 hits in seven innings with no walks and seven strikeouts.
J.J. Putz earned his first save this season.
San Francisco's Aaron Rowand had three hits, one a solo homer in the sixth, and three RBI.
Three others had one RBI and Pablo Sandoval had two hits for the Giants, who have lost three straight.
The losing pitcher was starter Randy Johnson (3-4), the 45-year-old left-hander who remains two victories shy of 300 career wins.
Notable deaths of 2014 [PHOTOS]