Peralta gets 3 hits, Tigers rally to beat Cubs 8-4