Southwark's planning committee has unanimously approved a proposal to build 38 new homes on the site of the former Esso service station in Old Kent Road.
However, the mosque charity was unable to raise enough money for the sale to proceed.
Instead the council sold the freehold to Charter Land for an undisclosed sum.
The scheme approved by councillors on Tuesday night includes 38 homes with a mix of private, shared ownership and social rented units.
The six-storey building has been designed by Spacelab.