"I am disappointed in myself for my lack of attention and actions on social media," Gragson posted Saturday. "I understand the severity of this situation. I love and appreciate everyone. I try to treat everyone equally no matter who they are. I messed up plain and simple."
Josh Berry will be in the No. 42 Chevrolet, making his Cup debut in Sunday's race at Michigan International Speedway to replace Gragson.
Floyd, who was Black, was murdered by a white police officer in 2020, and his death sparked mass protests around the world and forced a national reckoning on racial injustice.
In the wake of Floyd's death, NASCAR banned the Confederate flag at events and venues after Bubba Wallace -- its lone Black driver -- said there was "no place" for it in the sport. Earlier that year, Cup series driver Kyle Larson used a racial slur while playing a video game. Chip Ganassi Racing fired Larson and he was suspended by NASCAR, which required him to complete a sensitivity training course for reinstatement.
NASCAR said Gragson violated the member conduct of its rule book.
NASCAR fully supports Legacy Motor Club's decision to suspend Noah Gragson. Following his actions on social media, NASCAR has determined that Gragson has violated the Member Conduct section of the 2023 NASCAR Rule Book and has placed him under indefinite suspension.— NASCAR (@NASCAR) August 5, 2023
"His actions do not represent the values of our team," Legacy Motor Club said in a statement.
The 25-year-old Gragson, who is from Las Vegas, is in his first full season in the Cup series and is No. 33 in points.
The Associated Press contributed to this story.