FORT WORTH, Texas -- Jimmie Johnson still knows how to get to Victory Lane at Texas, even from the back of the field on a track that had changed significantly since his first six wins there.

And also while cramping because of dehydration late in the race that he won Sunday after charging under Joey Logano with 16 laps left .

"When I caught Joey and was racing with Joey, I started cramping pretty good on my left side -- my chest, and my bicep, my forearm," Johnson said. "I knew I was real low on fluids."

Johnson discovered right after the start of the 334-lap race that there was a problem with the fluid delivery system in his car. But that and the track changes didn't keep him from his first win this season, and the 81st in the career of the seven-time NASCAR Cup Series champion.

"I didn't really say much about it," he said. "I was so happy the car was running good, and we weren't making mistakes, I kind of overlooked it all."

Until he caught up with Logano after the final restart, and then got to Victory Lane.

While hot, Johnson said he initially felt better after getting out of the No. 48 Chevrolet. But when his back, chest and arms started to lock up while doing an interview, he went to the infield care center and got three bags of IV fluids.

When Johnson finally made it to the infield media center for his postrace interview about two hours after the checkered flag, he said he was feeling much better. He was also looking forward to his planned off-week trip to Mexico that he said would include a sunburn, margaritas, chips and guacamole.

Johnson and crew chief Chad Knaus said they weren't sure what caused the problem with the fluid system.

This was the first Cup race in Texas since the 1½-mile facility was completely repaved and changes were made to Turns 1 and 2 earlier this year. It was Johnson's seventh victory at Texas and sixth in the past 10 races there.

Kyle Larson, the season points leader, finished second for the fourth time this year but also won at California. Logano, pole sitter Kevin Harvick and Dale Earnhardt Jr. rounded out the top five.

Earnhardt also said he was hot after the race, because of a problem with the unit that is supposed to pump cool air through his helmet. Earnhardt, Johnson's teammate with Hendrick Motorsports, needed no special treatment.

Jimmie Johnson went from the back of the 40-car field to Victory Lane on Sunday at Texas Motor Speedway to notch his first win of the season and seventh at the revamped track. Sarah Crabill/Getty Images

Johnson had to start at the back of the 40-car field because of a tire change after a spin in qualifying. He had qualified 24th.

"I guess I remembered how to drive; and I guess this team remembered how to do it," Johnson said.

Johnson's only top-10 finish in the first six races this season had been ninth at Phoenix. Earnhardt had his first top-five finish since a runner-up at Pocono last June, not long before he missed the last half of the season because of lingering concussions symptoms.

"It was big for me," Earnhardt said after his first top-10 finish in his past 11 starts. "We haven't had a top-five finish since, like, four races before we stopped racing last year. This is great for us. I know the guys are excited. ... I was trying not to get frustrated, but you can only take so much."

Earnhardt admitted that the long layoff -- he spent seven months without racing before returning this season -- impacted his performance on his return.

"Confidence is probably half the battle for me," Earnhardt said. "I need all that I can get to have a shot. If I don't believe in it and have confidence in it, it's hard for me to go for it and drive with confidence. ... I felt like I had some catching up to do [in the car].

"I don't know exactly where. I can't really put my finger on it. But the confidence is part of it, just mentally to be able to get through an entire race and stay strong mentally. The physical part is one, the mental part is another thing. When you don't do it, your mind is not as mentally tough. I felt it."

Ryan Blaney won the first two stages and gave Wood Brothers Racing, the oldest active team in NASCAR, its longest front-running car in a race in 35 years. The 23-year-old Blaney finished 12th after leading 148 of 334 laps. It was the first time the team led more than 100 laps in a race since 1982.

Blaney first got the lead on the second early restart on lap 16, with a somewhat bold move around the outside of Harvick going through the reconfigured Turns 1 and 2, where the banking was reduced and the track widened.

During a caution on a few laps before the end of the second stage on lap 170, Blaney stayed on the track for a shot to win the stage while other cars pitted. Blaney restarted 20th after that stage and his stop, but after working back into the top 10, he overslid his pit on the last caution.

"That last pit stop was pretty discouraging," Blaney said. "I don't know what it was there at the end of segment two and that made everybody have split strategies, and we got in the back and couldn't pass anybody. It was terrible to try to pass people."

ESPN's Bob Pockrass and The Associated Press contributed to this report.