With 10 laps of the scheduled 267 to run, Hendrick Motorsports' Elliott was three points below the cutoff line for the 'round of eight' stage of the title fight.
Keselowski's Penske Ford Mustang sat perilously on the bubble, lacking pace while mired in the midfield but still on course to go through to the next round.
A series of cautions then followed that took the race to overtime, where the first attempt was interrupted by polesitter Daniel Hemric and Daniel Suarez clashing - causing a chain reaction in which reigning Cup champion Joey Logano went for a high-speed spin over the grass.
Stage one winner Logano had not looked in any jeopardy until that incident sent him tumbling down the order.
His eventual 16th place in his repaired car kept him in championship contention.
At the restart Hamlin's #11 JGR Toyota Camry held off Elliott's Chevrolet Camaro to take his fifth win of the season.
With Keselowski having a messy final restart and falling back to 19th, Elliott's second place got him into the next round by just three points.
Bowman could only make it to 11th after picking up early damage, but Byron ran strongly in the top 10 for most of the race.
He knew only a win would secure him passage into the next round, though, and finished fifth behind Busch brothers Kyle and Kurt.
Third and sixth places for Kyle Busch and Martin Truex Jr kept them in the title hunt based on their points from this round.
Erik Jones was seventh ahead of the highest placed Ford Mustang finisher, Clint Bowyer, in eighth - a result not good enough to prevent Bowyer's playoff elimination.
Bowyer's Stewart-Haas team-mate Kevin Harvick rose from last on the grid, after a driveshaft problem in qualifying, to ninth.
Seven-time Cup champion Jimmie Johnson rounded out the top 10 in his Camaro, despite running as high as third just before the overtime flags flew.
Kyle Larson dominated the opening stage for Chip Ganassi Racing, extending his lead by nearly a second a lap at times, but a late caution and subsequent restart hobbled the #42 and it dropped to a lowly 14th.
Both Larson and 21st-placed Ryan Blaney had earned their 'round of eight' places with race wins in the 'round of 12'.
Hemric, starting from his first pole position, quickly dropped back in the race on his way to a 31st place finish.
|1||Denny Hamlin||Joe Gibbs Racing||Toyota||277||3h02m39.s|
|2||Chase Elliott||Hendrick Motorsports||Chevrolet||277||0.128s|
|3||Kyle Busch||Joe Gibbs Racing||Toyota||277||0.266s|
|4||Kurt Busch||Chip Ganassi Racing||Chevrolet||277||0.493s|
|5||William Byron||Hendrick Motorsports||Chevrolet||277||0.543s|
|6||Martin Truex Jr.||Joe Gibbs Racing||Toyota||277||0.796s|
|7||Erik Jones||Joe Gibbs Racing||Toyota||277||1.005s|
|8||Clint Bowyer||Stewart-Haas Racing||Ford||277||1.125s|
|9||Kevin Harvick||Stewart-Haas Racing||Ford||277||1.405s|
|10||Jimmie Johnson||Hendrick Motorsports||Chevrolet||277||1.407s|
|11||Alex Bowman||Hendrick Motorsports||Chevrolet||277||1.537s|
|12||Ryan Preece||JTG Daugherty Racing||Chevrolet||277||1.786s|
|13||Chris Buescher||JTG Daugherty Racing||Chevrolet||277||1.948s|
|14||Kyle Larson||Chip Ganassi Racing||Chevrolet||277||2.233s|
|15||Matt DiBenedetto||Leavine Family Racing||Toyota||277||2.246s|
|16||Ricky Stenhouse Jr.||Roush Fenway Racing||Ford||277||2.589s|
|17||Joey Logano||Team Penske||Ford||277||2.604s|
|18||Paul Menard||Wood Brothers Racing||Ford||277||2.858s|
|19||Brad Keselowski||Team Penske||Ford||277||3.003s|
|20||Austin Dillon||Richard Childress Racing||Chevrolet||277||3.032s|
|21||Ryan Blaney||Team Penske||Ford||277||4.090s|
|22||Ty Dillon||Germain Racing||Chevrolet||276||1 Lap|
|23||Aric Almirola||Stewart-Haas Racing||Ford||274||3 Laps|
|24||Michael McDowell||Front Row Motorsports||Ford||274||3 Laps|
|25||Matt Tifft||Front Row Motorsports||Ford||273||4 Laps|
|26||David Ragan||Front Row Motorsports||Ford||273||4 Laps|
|27||Ross Chastain||Premium Motorsports||Chevrolet||272||5 Laps|
|28||Corey LaJoie||Go FAS Racing||Ford||272||5 Laps|
|29||Parker Kligerman||Gaunt Brothers Racing||Toyota||271||6 Laps|
|30||J.J. Yeley||Petty Ware Racing||Ford||271||6 Laps|
|31||Daniel Hemric||Richard Childress Racing||Chevrolet||270||Accident|
|32||Daniel Suarez||Stewart-Haas Racing||Ford||270||Accident|
|33||Reed Sorenson||Premium Motorsports||Chevrolet||268||9 Laps|
|34||Garrett Smithley||Rick Ware Racing||Ford||267||10 Laps|
|35||Darrell Wallace Jr.||Richard Petty Motorsports||Chevrolet||263||Accident|
|36||Josh Bilicki||Rick Ware Racing||Ford||262||15 Laps|
|37||Landon Cassill||StarCom Racing||Chevrolet||203||Vibration|
|38||Joey Gase||MBM Motorsports||Toyota||107||Accident|
|39||Timmy Hill||Spire Motorsports||Chevrolet||95||Too slow|
|40||Ryan Newman||Roush Fenway Racing||Ford||72||Accident|
|2||Martin Truex Jr.||4042|
Get unlimited access to the world’s best motorsport journalism with Autosport Plus