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.
For the latest local news and events direct to your inbox every Monday, you need our weekly email newsletter SE1 Direct.
7,000+ locals read it every week. Can you afford to miss out?
Read the latest issue before signing up