Mets edge Giants 5-4 on Posey's throwing error