Jonas Hiller made 34 saves in his 26th consecutive start for the Ducks, who aren't giving up on their unlikely playoff hopes. Anaheim finished a brutal stretch of six games in nine days in 12th place in the Western Conference with 68 points, five behind eighth-place San Jose.
Perry scored his 200th career goal with 3:20 to play before putting another puck into an empty net with 1:14 left. Jordan Eberle scored a power-play goal for Edmonton in between Perry's goals, but the Ducks hung on to earn their 42nd point since Jan. 1, tying them with St. Louis for the NHL's best record in 2012.
Jason Blake had an early power-play goal for the Ducks, who have won five straight and 10 of 11 over Edmonton.
Shawn Horcoff's slick deflection goal in the final minute of the second period tied it for the Oilers, who lost for the fourth time in five games despite dominating the weary Ducks for most of the final two periods. Nikolai Khabibulin made 26 saves for the NHL's worst road team, but the Russian goalie was heading to the bench for an extra skater when Perry scored his second goal.
Edmonton seemed firmly in control of the tied game before Ryan slipped behind the Oilers and took a pass from Teemu Selanne. Ryan flipped a backhand past Khabibulin while falling flat on his chest on the ice, scoring his 25th goal for the fourth consecutive season.
Selanne's assist put him in a 19th-place tie on the NHL career scoring list with Jari Kurri, his fellow Finn and personal hero who also scored 1,398 points.
Niklas Hagman then jumped on a turnover by former Ducks defenseman Ryan Whitney and fed it cross-ice to Perry, who scored his 32nd goal of the season.