Yes, if you owned investment property (or a second home) in Maine, but did not reside there, you will need to report any gain on the sale of the property. Therefore, you will need to file a tax return to report the sale of the property on a non-resident Maine return.
Here is information on filing a non-resident return in TurboTax:
https://ttlc.intuit.com/replies/3302052
Plus information on recording a sale of a second home or investment property in TurboTax:
https://ttlc.intuit.com/replies/4241480