Pirates score 3 in 7th to beat Dodgers 6-3