Don't do that. You should value yourself and your work.
At the end of your contract, polish up your resume, and create a nice list of projects where you can add value. Ask about having your contract renewed and be prepared to present both.
If your work has value to them, they should consider continuing your employment. If not, attempting to work for them for free will only create an awkward situation for you, your managers, and all the other employees on that team.
If this company can't pay you, find an opportunity that can. Businesses are not charity cases.
Update: @user8358234 if you're staying on to have your work published in papers, then this is an academic concern, not one of employment. The reason people reacted negatively to your question is that businesses often take advantage of unpaid interns, and because of that, those who cannot afford to take an unpaid internship lose opportunities in those fields.
Staying on to be published in academic papers in some instances is the equivalent of paid work, especially if you're already supported through your PhD program. You should have asked your academic advisor about the best way to work with this company, instead of creating an unclear question here.