The official margin was 0.002 seconds, tied for the closest finish in NASCAR Sprint Cup history.
The tag-team race came down to an eight-car sprint -- actually, four pairs of cars -- with only the guys at the front of the duos having a chance to win the Aaron's 499.
After laying back most of the day, five-time series champion Johnson came on strong at the end for his 54th career victory and first of the season.
"We were just the lucky guy at the end with a good run," Johnson said. "We had some big mo on our side, and off we went."
Coming out of the fourth turn, the No. 48 car dipped right next to the yellow line, surged past Hendrick Motorsports teammates Jeff Gordon and Mark Martin and got to the finish line just ahead of Bowyer in a four-wide dash down the long finishing straight at Talladega Superspeedway.
"What a bummer," said Bowyer, who led a race-high 38 laps. "I saw him coming."
Earnhardt, the fourth Hendrick driver, finished fourth and essentially gave up a chance to claim his first win since 2008 by deciding he was more comfortable pushing Johnson than getting pushed.
"I can't thank Junior enough," said Johnson, who gave Earnhardt the checkered flag as a reward for being such a team player. "He made the decision that my car was faster leading. And the way these things are finishing up, the lead car's going to get the win. In some respects, he was more worried about the team having a good performance than anything."
Kevin Harvick, who was Bowyer's pusher, wound up fifth. Carl Edwards almost got into the mix as well, going right up against the outside wall with Greg Biffle on his bumper but didn't have enough room to pull it off, finishing sixth.
Biffle was seventh, while Martin dropped back to eighth.
The finish matched the closest since NASCAR went to electronic timing -- Ricky Craven edging Kurt Busch in 2003 at Darlington -- and made up for a day of lackluster racing with this new tandem style, which the drivers began using at the season-opening Daytona 500 and really perfected at this 2.66-mile trioval.
Twenty-six leaders swapped the top spot 88 times, tying the record set in last year's spring race at Talladega. Many of those changes were carefully choreographed by pairs who were merely trying to stay out of trouble, conserve their cars and give themselves a chance at the end.
"If you didn't like that finish and forget about the race, there's something wrong with you," Bowyer said. "It always seems to fix itself at the end of these restrictor-plate races. We always have a hell of a finish."
Hendrick Motorsports claimed the first four spots in qualifying, only the third team in NASCAR history to sweep the first two rows in a Cup race. They were all right there at the end.
"With as crazy as it gets in these closing laps, sometimes a third is almost like a victory at these type of race tracks," Gordon said.
The finish overshadowed the mundane riding-around that came before it.
Rather than run together in huge drafting packs, which used to be the norm at the restrictor-plate tracks, the drivers figured out they can run even faster in pairs. So, everyone cut deals before the race, usually with teammates, and swapped radio frequencies so they could make changes on the fly if needed once the green flag dropped.
One guy in the pairing would run out front for a while, then they'd switch positions before the driver doing the pushing overheated his car.
The most important thing was staying together. During an early pit stop, Johnson stayed in a little longer to make some adjustments on his car. Earnhardt just idled in his box, waiting to go back out with his partner.
Of course, bumping cars from behind and pulling off choreographed switches at 190 mph didn't always go smoothly -- especially when the second driver in a tandem can't see a thing.
Busch can attest to that. He twice got into cars while pushing, totally blind to what was going on in front of him.
First, the No. 22 car nudged the rear bumper of Landon Cassill's machine on lap 28, sending him into Brian Vickers, whose car smashed into the outer wall at the start of the backstretch. Fortunately, Vickers entirely missed a wave of cars bearing down on his sliding vehicle.
Busch was at the center of things again on the second crash of the day. He appeared to clip Brad Keselowski from behind when the lead car slowed, sparking a five-car melee that also took out Daytona 500 winner Trevor Bayne, David Ragan, Marcus Ambrose and Kasey Kahne.
"Just one of those deals here at Talladega," Keselowski said. "I just got on the wrong end of it."
Kahne tried to nurse his smoking car back to pit road, but finally had to bring it to a stop and hustle out.
"The car just got some flames in the back because of the oil, I guess," he said. "I sucked up a little bit of black smoke, but that was it. I stink, too."
The 20-year-old Bayne had another disappointing finish since his improbable Daytona win in just his second Cup start. The youngster hasn't finished higher than 17th since then.
He certainly had a car that was strong enough to contend at Talladega, qualifying a career-best 11th and running up front three times for five laps.
"I thought we were kind of out of harm's way there but, obviously, we weren't far enough back out of it," Bayne said.
Another Busch, Kurt's little brother Kyle, was taken out in a third wreck that was a virtual copy of the first two. Joey Logano bumped the No. 18 car, sending it spinning hard into Matt Kenseth and taking out two other cars, as well.
"So much is out of your hands here," Kenseth said. "It's a frustrating type of racing, to say the least. It would be nice to be able to see and control your own destiny a little more."