A consortium of German car makers—including the parent companies of Audi, Mercedes-Benz and BMW—are on the verge of buying Nokia’s digital mapping service, a technology that is crucial for self-driving cars.

The luxury car makers have begun to draw up a contract with Nokia, agreeing to pay over €2.5 billion ($2.7 billion), a person familiar with the situation told the Wall Street Journal, which reported that a deal could be announced in the next few days. That would trump rival...