Edwards, making his first Nationwide start of the season, beat Keselowski on a two-lap dash to the checkered flag on Saturday and won the Zippo 200 at Watkins Glen International.
Austin Dillon's blown right front tire brought out the final stoppage of the 82-lap race around the 11-turn, 2.45-mile layout, and Edwards beat his long-time nemesis on a restart for the second straight time in the race.
It was the 38th career victory for Edwards, breaking a tie with Kevin Harvick for third on the career series list.
"This is huge for us," Edwards said after making his celebratory back flip. "This win means a lot."
Pole-sitter Sam Hornish Jr. Jr. finished third, followed by Ricky Stenhouse Jr. and Ron Fellows. Despite a spirited drive from the back of the field, Kyle Busch faded late and finished sixth in his No. 54 Toyota.
Elliott Sadler finished 12th and holds a 13-point lead over Stenhouse in the standings.
Edwards pulled away on the final restart speeding up through the esses before Keselowski began to close. Edwards missed a shift and Keselowski's Dodge pulled alongside Edwards' No. 60 Ford as the two banged in the turn at the top of the front straightaway heading to take the white flag.
Edwards then pulled ahead and sped away to a 1.1-second triumph.
"He came up the track and hit me, put me in the wall there," Keselowski said. "That kind of took away all of my momentum. I didn't have a chance after that."
The two had passed each other for the final lead change in a race six times, with Keselowski getting the better of Edwards four times before Saturday.
Keselowski, who watched last year's race from the television booth with a broken left ankle and bruised back, started fourth and showed right away he'd be a factor. He took the lead in the chicane on lap 12 from teammate Hornish, outbraking him entering the quick four-turn section.
A crash entering the chicane involving Cole Whitt and Victor Gonzalez Jr. had forced the previous stoppage on lap 70. The race restarted with 10 laps to go with Keselowski and Edwards on the front row.
"He'll be coming and it's just a matter of whether we can hold him off," Jeremy Bullins, crew chief for Keselowski, said of Edwards.
Keselowski couldn't as Edwards took the lead with a powerful pass to the outside going uphill through the esses. Busch, battling shifter and throttle problems, dropped to sixth on lap 76.
Danica Patrick, who had a strong run at Road America in the first road course of the season before getting wrecked by Jacques Villeneuve and finishing 12th, didn't even get the chance to race in her first NASCAR start at The Glen. She was taken out on the first turn of the first lap by Ryan Truex.
Truex slid across the grass on the inside of the 90-degree right-hander, came back onto the track in front of Patrick's No. 7 Chevy, and she had nowhere to go.
"I just feel so bad," said Patrick, who had to retire from the race and finished last. "That's the sport. It's out of your control."