The inhabitants of any city may by subscription or otherwise purchase or receive by gift or donation, lands not exceeding five acres to be used as a cemetery, the title to be vested in the inhabitants, which lands when once dedicated to use for burial purposes, shall not thereafter be used for any other purpose.