Zaidi, 41, leaves the Dodgers after four years working under team president Andrew Friedman. The Dodgers made the World Series each of the past two seasons.
"We set out to find one of the best minds in baseball and Farhan's many accomplishments and expertise exceeded our expectations," Giants president Larry Baer said in a statement. "Farhan is widely viewed as one of the top executives in our industry and we are thrilled to have him lead the next chapter of Giants Baseball."
Zaidi returns to Northern California, where he worked for the Oakland Athletics as assistant general manager before joining the Dodgers in 2014.
"I am delighted to return to the Bay Area and to join one of the most storied franchises in the game," he said. "I have watched the Giants from afar and I have great respect for the organization's culture and many accomplishments. I am excited about this new opportunity and I'm looking forward to getting right to work."
The Giants dismissed general manager Bobby Evans in September. San Francisco went 73-89 in 2018, including a majors-worst 5-21 in September.
The Giants have missed the postseason the past two seasons after winning three World Series titles in five years earlier this decade.