MARTINSVILLE, Va.—Jeff Gordon pulled into the championship picture Sunday with a win at Martinsville Speedway, his first of the season.

It was Gordon’s eighth career win at Martinsville, but first since he swept the two races at the track in 2005. He’s tied with Hendrick Motorsports teammate Jimmie Johnson for Martinsville victories, but both trail Richard Petty (15) and Darrell Waltrip (11) on the career list.

Most important, though, is that the victory moved Gordon from fifth to third in the Chase for the Sprint Cup championship.

Kenseth led a race-high 202 laps and was out front on the final restart with 77 laps remaining and Gordon lurking in third. Gordon stalked him for more than 50 laps, thinking to himself, “What would Jimmie Johnson do, or better yet, what would Richard Petty do?” before finally making the pass for the lead with 21 laps remaining.

Gordon didn’t look back in snapping a 32-race losing streak dating to last year’s season finale at Homestead.

“Matt drove a really first-class caliber race today and I didn’t know if we were going to get him, but it sure was awesome when we finally did and just kind of hoped there were no cautions,” Gordon said.

Kenseth finished a career-best second at Martinsville and closed the gap on Johnson, who was up four points as they came into one of Johnson’s best tracks and one of Kenseth’s worst tracks. He had to drive from the middle of the pack to save his finish after a call not to pit midway through the race backfired, but Kenseth was still a bit disappointed not to leave with the victory.

“Whenever your team puts you in front for that last run and you’re out there leading, you get beat, you’re always a little bit disappointed,” Kenseth said. “I just got beat by honestly experience and a better driver of this track. I was hesitant to change my line and do the things he was doing because what I was doing got me there. Just got too tight at the end. Wish I could do it over.”

Clint Bowyer finished third, his best finish of the Chase, and moved two spots in the standings to sixth.

Defending Sprint Cup champion Brad Keselowski, who is not part of the Chase, was fourth.

Johnson finished fifth and braced for an epic fight for his sixth championship.

“It’s been a great battle with (Kenseth) and (Gordon) has really shown that he wants to be part of this deal as well,” Johnson said. “It’s going to be a dogfight to the end—the way I would like to race for a championship, and I know that’s what the fans want to see, so we’ll be digging hard.”