Lynn leads Cardinals to 4-1 win over Pirates