We prove a version of Kontsevich’s formality theorem for two subspaces (branes) of a vector space X. The result implies, in particular, that the Kontsevich deformation quantizations of S(X*) and ∧(X) associated with a quadratic Poisson structure are Koszul dual. This answers an open question in Shoikhet’s recent paper on Koszul duality in deformation quantization.