Jeb Burton led on the final restart with three of 113 laps to go but Haley, with a push from Chastain, bolted into the lead coming to the white flag, signaling one lap remaining.
Haley than out-dueled Chastain to the finish to win Saturday’s Unhinged 300, his first Xfinity Series victory.
Haley, 21, has now won at least one race in each of NASCAR’s three national series. He won three times in Trucks in 2018 and captured a shocking rain-shortened victory in the Cup Series at Daytona in 2019.
"First of all, I want to dedicate this win to Nick Harrison (his former crew chief) and the Harrison family. He started this journey with me last year, my rookie year and losing him was pretty big," Haley said. "It's just an incredible day, emotionally. I'm fighting for a ride, fighting for the next time I get in a race car next year so any time you can win, it definitely helps.
"Hats off to the No. 11 crew, everyone at Kaulig Racing. Matt Kaulig we love you. I have to thank my family."
Asked about why he climbed out of the right-side of his car, Haley said, "I've been thinking about. Everyone has their own deal. That's mine, that's going to be my signature mark, only because I'm the littlest guy. I think I'm the only one who can do it and I still struggled."
Chastain ended up capturing the $100,000 Dash4Cash bonus as the highest finishing eligible driver. Haley, Chastain, Jeb Burton and Austin Cindric are eligible for the bonus next weekend at Pocono.
Burton ended up finishing third, Cindric fourth and Brett Moffitt rounded out the top-five.
With 40 laps remaining in the race, Noag Gragson and his four JR Motorsports teammates remained out front as teams began formulating plans to make their final green-flag pit stop in the race.
Several drivers elected to pit on Lap 77 but as the rest of the field entered Turn 1, Moffitt turned Riley Herbst in an incident that also collected Chase Briscoe to put the race under caution.
Riley Herbst goes around at Talladega (that could have been SO much worse). pic.twitter.com/c2qExPgkCI— FOX: NASCAR (@NASCARONFOX) June 20, 2020
The remaining drivers elected to pit under the caution with Gragson the first off pit road. On the restart on Lap 81, Chastain led the way followed by A.J. Allmendinger, Haley and Gragson.
With 20 laps to go in the race, Chastain maintained a small advantage out front over Allmendinger. Jeb Burton was third, Justin Allgaier fourth and Gragson ran fifth.
On Lap 96, a multi-car wreck erupted in Turn 3 which collected Harrison Burton, Josh Williams, Joe Graf Jr., Caesar Bacarella, Kody Vanderwal and Jeffrey Earnhardt. The incident seemed to start with Vanderwal and Earnhardt making contact.
The race was placed under the red flag to clean the track of debris. The race returned to caution following a nearly 11-minute delay. Chastain led the way on the restart on Lap 100.
On the start on Lap 102, Cindric got around Chastain with help from Jeb Burton to grab the lead for the first time in the race. On Lap 105, Jeb Burton was able to clear Cindric to grab the lead.
The next lap, Allgaier got into the back of Gragson, who was being blocked by Chastain, to send him spinning and then Brandon Jones got into Allgaier, which collected several more cars to place the race back under caution and into the second red-flag of the race.
Following a nearly 5-minute delay, the race returned to caution. Jeb Burton led the way on the restart with three laps remaining.
Briscoe withstood a last-lap charge from Michael Annett to hand on to the Stage 2 victory.
Cindric was third, Gragson fourth and Chastain completed the top-five.
Following the break between Stages 1 and 2, most lead-lap cars pit but Harrison Burton stayed out and inherited the lead. Jones was the first off pit road among those who pit.
Allmendinger was penalized for having too many crew members over the wall during his stop and had to restart from the rear of the field.
On the restart on Lap 30, Burton was followed by Allgaier, John Jackson and Brandon Jones.
Allgaier got around Harrison Burton through Turns 3 and 4 on the restart lap and grabbed the lead for the first time in the race.
Chastain got a push into the lead on Lap 32 and Anthony Alfredo worked his way round Chastain to grab the lead on Lap 34.
At the start of Lap 39, Briscoe got a push from Cindric and moved into the lead for the first time in the race.
With two laps remaining in the stage, Briscoe remained out front and in command.
Haley held off a strong challenge from Alfredo to take the Stage 1 victory, the stage win of his career.
Briscoe was third, Chastain fourth and Jones completed the top-five.
Haley, who started on the pole by virtue of a random draw, led the first four laps until Annett moved into the lead on Lap 5.
On Lap 11, NASCAR displayed a competition caution to give teams a chance to check tire wear. Many lead-lap cars remained on the track and did not pit.
Annett led the way on the restart on Lap 15, followed by Haley, Chastain and Alfredo.
As the field completed the first lap after the restart, Haley, Annett and Chastain went 3-wide for the leader with Chastain coming away with the lead.
One lap later, Haley got back around Chastain to reclaim the lead.
With five laps remaining in the stage, Haley remained out front followed by Alfredo and Chastain.
The cars of Jeb Burton and Allmendinger had to start the race from the rear of the field after both of their cars failed pre-race inspection three times