The Flyers overcame a three-goal deficit and tied it on Scott Hartnell's 10th of the season with 3:02 remaining in regulation.
Giroux then won it on the Flyers' 44th shot of the game.
The victory came in the second outing of a four-game road trip on which Philadelphia has traveled to New York and California, before heading to Arizona and then back to New York. The Flyers are 1-1 on the journey.
Andrew Gordon gave Anaheim a 3-0 lead 6:31 into the second period, but Jaromir Jagr scored on the power play to start the Philadelphia comeback late in the middle stanza. Jagr scored another power-play goal 4:46 into the third before Hartnell forced overtime.
Anaheim had been trying to win consecutive games for the first time since capturing four in a row during the first two weeks of the season. The Ducks have just seven wins, tying them with Columbus and the New York Islanders for fewest in the league.
All three of those teams lost Friday.
Ilya Bryzgalov stopped 19-of-22 shots in the victory.