Calvin McIntosh, from Larkhall, was driving his BMW when it was in a collision with a Volkswagen Polo at about 17:00 on Saturday.
Mr McIntosh sustained serious head injuries and died at the Queen Elizabeth University Hospital in Glasgow on Wednesday.
Two women travelling in the other car are in a stable condition in hospital.
The 58-year-old driver suffered leg and back injuries, and her 24-year-old daughter sustained internal injuries.
Police have appealed for anyone who may have witnessed the crash, or who has information that could assist the police, to contact them.
They said a number of passing motorists had already come forward.
A 19-year-old man involved in a two-car crash on the A71 in Larkhall in South Lanarkshire has died in hospital.