With two rounds to go, five-time champion Johnson now has a bigger edge after a slugfest in Texas that included some hard banging late.
Johnson regained the lead on the final restart on the 334th of 335 laps before holding off the young challenger in an ending shootout for a 1-2 finish in Texas.
"It was an awesome race. It's a great way to do it when the gloves are off and it's bare-knuckle fighting," Johnson said. "I got a great restart and got by him. I knew we had the speed if I could just get by him."
They were side-by-side on the final restart, but Johnson charged his No. 48 Chevrolet hard on the outside, cleared Keselowski on the backstretch and led for the final 1½ laps. Johnson won from the pole for the second week in a row, and increased his series lead by five to seven points.
Though he led 168 laps, Johnson found himself chasing for much of the final part of the race. And it wasn't until the last of three restarts in the final 19 laps that Johnson finally went ahead for good.
After falling from first to ninth during the previous stop when he got slightly blocked in his stall and then caught in a jam on pit road, Keselowski opted for only left-side tires on his No. 2 Dodge when everybody else took four tires.
He restarted in the lead with 19 laps left, and the strategy might have worked. But there were still two more restarts, and Johnson pulled ahead in the one that counted most.
"Getting that last yellow, I felt like restarts are like rock, paper, scissors. Eventually you're going to lose them. It's just a matter of time," Keselowski said. "To win two out of three, I felt lucky to do that."
They go to Phoenix next week, where Johnson was fourth and Keselowski fifth in the second race of the season eight months ago. The season finale is at Homestead.
Keselowski had never finished better than 14th at Texas before leading 75 laps in a runner-up showing that still wasn't good enough to make up ground on Johnson.
"It was a fun day for sure," Keselowski said. "We'll keep fighting."
After Johnson got loose when he was on the high side racing with Keselowski, the two made hard contact close to the start-finish line.
They kept going forward, and Johnson had a slight lead at the end of that lap. Keselowski pulled ahead, and stayed there until Mark Martin spun out to set up a green-white-checkered finish.
"I just pointed at him, just wanted him to use his head. No need to take us out in the process," Johnson said of the racing against Keselowski. "The cool thing about it, we walked up to that line, got to the edge, and it stopped."
One of the people who went to Victory Lane to shake Johnson's hand was Keselowski.
"I raced hard, and I'm sure someone would say dirty," Keselowski said. "But I raced hard and we both came back around, so there's something to be said for that."
It was Johnson's 60th career victory and second at Texas, where he was the runner-up in April. It was also the 700th NASCAR Sprint Cup victory for Chevy, and means a huge donation for disaster relief efforts on the East Coast in the wake of Superstorm Sandy.
Johnson's primary Hendrick Motorsports sponsor Lowe's pledged to match what he earned at Texas. The winning share of the $7 million purse was $492,086.
There were nine cautions for 49 laps, including that late flurry that changed the race. It sure didn't start that way, but then there were some yellow flags in bunches.
Keselowski had more than a two-second lead over Johnson when there was a caution for debris with 59 laps left. But Keselowski got in his pit box awkwardly, then had to back up to get around Danica Patrick's car in the stall ahead of him and pulled out into a big jam of cars.
Keselowski worked himself back up to fourth before the next stop, when he took two tires.
After the April race at Texas ended with a track-record 234 consecutive green-flag laps, the first 100 laps Sunday were without a caution. That 334 laps was the equivalent of 501 miles, or a full Sprint Cup race at Texas.
The first caution was caused by debris on the track, and there were two more cautions within a span of 20 laps after that.
During that first stop, Keselowski also took only two tires and within two laps led his first lap to get a bonus point after passing Ryan Newman, who hadn't pitted. That was a short-lived lead before AJ Allmendinger spun out of control out of Turn 4 into the infield.
Keselowski and Johnson re-started side-by-side and in the one green-flag lap that was completed before another caution, Johnson edged back in front.
It had been a smooth Sunday drive for Johnson before all those interruptions.
Johnson charged ahead, and was quickly a few car lengths in front of the field. Within three laps after the first pit stop, he cycled back into the lead with Keselowski four spots and 5.3 seconds behind.
Following the second set of green-flag stops, Johnson and Keselowski were 1-2, but there was a nearly 4-second gap between them.