Peralta (4-6) surrendered eight hits, allowed one walk and struck out six in breaking a string of four losses in four games.
Brandon Kintzler recorded three outs to preserve a scoreless eighth inning before Francisco Rodriguez took over in the ninth with a 4-2 lead.
After Freddy Galvis led off with a solo homer, cutting the Phillies' deficit to one run, pinch-hitter Jimmy Rollins followed with a single and pinch-runner Kyle Kendrick went to second on Ben Revere's sacrifice.
Rodriguez then tried for a pickoff at second base. He fell down while throwing to the bag, unleashing a low throw. Shortstop Jean Segura dove to make the grab and applied a tag on Kendrick, who was ruled out.
Replays, however, showed Segura had dropped the ball. Cesar Hernandez (3-for-5) followed with a double -- which would have scored the tying run -- but was stranded after Rodriguez got the final out for his third save.
Jonathan Lucroy homered and Logan Schafer went 3-for-4 with an RBI for the Brewers, who clinched their three-game series.
Phillies starter Travis Cloyd (1-2) yielded three runs (two earned) on eight hits over seven full innings.