Updated

Martinsville, VA (SportsNetwork.com) - Jeff Gordon kept his hopes of winning a fifth Sprint Cup Series championship alive by winning his first race of the season on Sunday at Martinsville Speedway.

Gordon passed Matt Kenseth for the lead with 21 laps remaining and then held off Kenseth at the finish by 0.6 seconds to win the Goody's Headache Relief Shot 500 -- the seventh race in the Chase for the Sprint Cup championship.

It was Gordon's 88th career victory in NASCAR's premier series but his first since the 2012 season-finale at Homestead (33-races ago). He also scored his eighth win at Martinsville, which placed him in a tie with his Hendrick Motorsports teammate, Jimmie Johnson, for third on the track's all-time race winners list. Gordon's last victory here came in October 2005.

"We had to really run in Matt's tracks," Gordon said. "He was strong. I felt like they made some adjustments, made his car even better. That's probably the most patient I've had to be here, or in a race in a long time, just because I didn't see his car fading like I thought it would. It just took a little longer, and it finally did start to give up a little bit, and we took advantage of that."

Kenseth's second-place run coupled with a fifth-place finish for Johnson allowed Kenseth to move into a points tie with Johnson. Both drivers have 2,294 points apiece with just three races to go -- Texas (next Sunday), Phoenix (Nov. 10) and Homestead (Nov. 17).

With the win, Gordon climbed from fifth to third in the Chase standings. He is now 27 points behind Kenseth and Johnson.

Two days before the Chase began at Chicagoland, Gordon was added as the 13th driver in the Chase field due to the controversial finish in the Sept. 7 regular-season-ending race at Richmond. The sanctioning body made the decision to include him in the playoffs in what NASCAR chairman and CEO Brian France described as "an unprecedented and extraordinary set of circumstances that unfolded in multiple different ways" at Richmond. Gordon finished eighth there but had come up only one point short of qualifying for the Chase.

"There's no better time to win races than right now, and to be able to carry that momentum," Gordon said. "I'm so proud to be third in the points. We all want to win the championship, but I mean, from where we started early in the season, heck, where we started in this Chase, to be third in points right now, I'm very proud of that.

"We can't get the cart ahead of the horse. We've got to appreciate that but also take advantage of this momentum and confidence that we do have. I can't wait to get to Texas."

Gordon became the 16th different race winner in Sprint Cup this season. His fourth and most recent championship in the series came in 2001.

Kenseth is credited with leading the point standings by virtue of his series- leading seven wins this season compared to five victories for Johnson. Kenseth led a race-high 202 laps. He has yet to win at Martinsville in 28 attempts.

"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 and just got too tight at the end, which I wish I could do it over. I just got slowed up with some lapped cars and he got by. But overall, it was a great day."

Johnson led a total of 123 laps, in an attempt to win his third consecutive Martinsville race. The five-time series champion took over the top ranking in the Chase after last weekend's race at Talladega, holding a four-point advantage over Kenseth.

"It's been a great battle with (Kenseth), and (Gordon) is really showing that he wants to be a part of this deal as well," Johnson said. "It's going to be a dogfight to the end. I know it's the way that I would want to go racing for a championship, and I know that's exactly what the fans want to see."

Clint Bowyer finished third, while Brad Keselowski took the fourth spot.

Kevin Harvick, Denny Hamlin, the pole sitter, Dale Earnhardt Jr., Greg Biffle and Jamie McMurray, who won at Talladega, completed the top-10.

Harvick remained fourth in points (-28), while Kyle Busch dropped from third to fifth (-36) following his 15th-place finish. Bowyer moved up two positions to sixth (-55).