ANSWER - Earthing and grounding differ slightly in definition and I suspect that what you are referring to here is the process of earthing. Earthing is making contact with the earth, normally in bare feet and for the purpose of absorbing the energies of the earth into the body. Grounding is the process of channelling your excess energies into the earth. (Definitions vary between witches but this is a good basic overview).
In terms of grounding I don't think not having direct contact with the earth is a barrier. I tend to ground indoors myself (usually on the second floor) and with practise it is easy to establish a mental link between the self and the earth. The trick to grounding indoors is to focus on sinking your energies through the levels of the house and beneath into the earth. If you visualise transcending each barrier it should get more comfortable to project the tired energy and focus it draining from you. Remember that what would be a physical barrier to the body need not be a barrier to the mind.
Earthing by its very nature is going to be harder without a garden but I do have some suggestions. Instead of walking on the actual earth you could make a ground substitute. One of the best ideas I've ever seen on this subject was a witch who grew a tray of grass (just as you would a houseplant) and kept it indoors to stand on when grounding/earthing.
You could also put a stage between yourself and the earth - you could take a stone or a rock and hold it when you ground, projecting your energies into the stone. This could then be buried in the communal garden for the earth to break down the negativity in the stone naturally. You could achieve the same effect by siphoning your emotions into a bowl of water and then taking it outside and pouring it on the earth.
Nothing to stop you holding one of your houseplants, allowing it to absorb your energies and then putting it in the moonlight to bathe away any negative energy that in a more traditional method of grounding/earthing would have been absorbed into the earth.
Image http://www.freeimages.com/photo/1445310%20 pasip