SAN FRANCISCO — DoorDash, the food delivery start-up, said Thursday that it was buying Caviar, a rival service, for $410 million in a deal that escalates the already intense competition in food delivery.

DoorDash is buying Caviar from Square, the payments company, which has owned the service since 2014. Caviar operates in around 15 cities and primarily offers food from upscale restaurants in urban areas.

Tony Xu, chief executive of DoorDash, said Caviar’s selection of higher-end restaurants in cities complemented DoorDash’s offerings, which skew more heavily toward chain restaurants in the suburbs. When Jack Dorsey, chief executive of Square, called him about a potential deal, he said, it was a “short conversation.”

Postmates, DoorDash, GrubHub and Uber Eats have been locked in an increasingly intense fight for customers, drivers and restaurant clients. The companies have faced intensified scrutiny and attention with the initial public offering of Uber in May and potential I.P.O. of Postmates. In February, Postmates confidentially filed paperwork with the Securities and Exchange Commission, but has not set a date for any listing.