Richmond, VA (Sports Network) - Dale Earnhardt Jr. topped his Hendrick Motorsports teammate, Jeff Gordon, by a slim margin to win Friday's qualifying for the Federated Auto Parts 400 at Richmond International Raceway.

Earnhardt, who was the second-to-last driver to qualify in the 45-car field, turned a lap at 127.023 mph to claim his 11th career Sprint Cup Series pole but his first since the 2011 season-opening Daytona 500. He is one of 10 drivers who has already secured a spot in the 12-driver field for the Chase for the Sprint Cup championship.

"I've not really been the best of qualifiers the last couple of years," Earnhardt Jr. said. "We have a lot of improvements we've made this year. It feels good to get a pole."

Earnhardt Jr. ended a four-year, 143-race winless streak in June at Michigan. He is currently second in the point standings.

Gordon, who is one of eight drivers battling for the two remaining positions in the Chase, secured the outside pole with a lap at 126.981 mph. Gordon's time was just 0.007 seconds behind Earnhardt Jr.

"I just didn't quite get through (turns) one and two the way I would have liked to," Gordon said. "I actually got down to the yellow line a little bit earlier than I wanted to. I could have carried a little bit more speed in there. "

Regan Smith qualified third, followed by Clint Bowyer, Jimmie Johnson and Mark Martin.

Denny Hamlin will start seventh in his attempt to win a third consecutive race. Hamlin, who hails from nearby Chesterfield, Va., won at Bristol and Atlanta prior to Richmond.

"I think we're going to have a good (car), and I think we've got a great shot at three in a row," said Hamlin, who has at least clinched a tie for the first seed in the Chase due to his series-leading four wins. "We've just got to keep it going."

Heading into Saturday night's regular-season-ending race at this 0.75-mile racetrack, Kasey Kahne holds the first of two wild card positions by virtue of his two wins this season. Kahne will start 21st. Kyle Busch occupies the final wild card spot. Busch qualified 15th.

Gordon is third in the wild card rankings and trails Busch by 12 points. Both drivers have one win a piece.

"It's been a solid day, and we have a good race car," Gordon said.

Stewart, currently 10th in the point standings, qualified 28th. Stewart is guaranteed a position in the Chase since he has three victories for the year.

Other Chase contenders and their starting positions include: Joey Logano (eighth), Ryan Newman (14th) Carl Edwards (16th), Marcos Ambrose (22nd) and Paul Menard (25th).

J.J. Yeley and Mark Green failed to qualify for the 400-lap race at Richmond, which is scheduled to start just after 7:30 p.m. (ET).

More From KLTD-FM