It proved to be just enough on a night when the Dodgers again struggled offensively.
"I hadn't pitched in a while and the velocity was probably the best it's been all year," said Anderson, who missed a start because the Dodgers had two off-days last week. "It was kind of tough to command early on, just because it was coming out of my hand pretty good, but I was able to make some pitches and -- not coast -- but get a good quality start and get us a win."
Anderson (6-6) allowed one run and four hits while striking out five and walking two. The major league leader in ground-ball percentage entering the game recorded 10 outs on grounders. He also improved to 6-0 while working with catcher A.J. Ellis this season.
"He has a game plan," Anderson said of Ellis. "He does a ton of scouting. I feel like I just ride the wave."
Ellis was making his first appearance since coming off the disabled list Tuesday.
"We're generally on the same page going in there and it's just kind of up to him to execute," Ellis said, "and he did an amazing job tonight."
Second baseman Howie Kendrick had three hits for the Dodgers, who won for the fifth time in six games. Los Angeles, however, left 12 men on base, one night after stranding 13 in a 6-2 loss to Philadelphia.
"I'm not going to go too far because we got a W and that's what it's all about at the end of the day," Dodgers manager Don Mattingly said. "But you hope it doesn't come back to haunt you."
Right fielder Jeff Francoeur hit a two-run homer for the Phillies, who lost for just the fourth time in 17 games since the All-Star break.
"Although we lost, we fought them pretty hard," Phillies interim manager Pete Mackanin said. "We're not out of games. We had a good chance to come back and win that game."
Pedro Baez worked a scoreless inning in relief for the Dodgers, but Jim Johnson surrendered Francoeur's two-run shot in the eighth when the Phillies cut Los Angeles' lead to 4-3. It was the 10th homer of the season for Francoeur and the 150th of his career.
Kenley Janson struck out the side in order in the ninth for his 20th save.
Phillies starter Aaron Harang, bidding to win consecutive starts for the first time this season, instead took the loss to fall to 5-12. He went five innings and allowed four runs and seven hits while striking out one and walking five.
Kendrick and first baseman Adrian Gonzalez each singled with one out in the first inning. One out later, Puig hit an 0-1 curveball from Harang into the seats in left field for his eighth homer of the season. To that point, it was also Puig's sixth hit in seven lifetime at-bats against Harang, three of which went for extra bases.
Harang said the homer came on "a poorly executed pitch" and added, "I was off today."
The Phillies cut it to 3-1 in the third when third baseman Maikel Franco lined an RBI double off the fence in right field. Center fielder Odubel Herrera, on first base courtesy of a fielder's choice, came around to score.
A run-scoring groundout by Gonzalez in the fifth gave the Dodgers a 4-1 cushion.
NOTES: Phillies interim manager Pete Mackanin, who took over when Ryne Sandberg resigned June 26, said he doesn't think about his job status beyond this season. "Everything's up in the air," he said. ... Tiffany Billingsley, wife of Philadelphia RHP Chad Billingsley, was declared cancer-free last month after being treated earlier this season for a rare and aggressive form of the disease known as gestational choriocarcinoma. According to an MLB.com report, the Billingsleys hosted 100 staffers from Thomas Jefferson Hospital, where Tiffany underwent chemotherapy, at Wednesday's game. Two of her doctors, Russell Schilder and Norm Rosenblum, and her nurse practitioner, Amanda Jackson, were recognized on the field beforehand. ... RHP Walker Buehler, the Dodgers' first-round draft pick in June out of Vanderbilt, underwent Tommy John surgery on Wednesday in Los Angeles. His expected recovery period is 12-18 months.