It's been some years since I did this (so some details may have changed), but yes, it should be possible. I did it when I switched rental cars at the border, to beat the huge drop-off fee. We went the other direction (southbound); dropped our car in Piran and caught a small bus to Rovinj (after a day and a night there in Rovinj, we picked up our 'Croatia car' there, then continued on). A few things I would suggest you be careful about...
There was no bus station of any sort (that we could find) in Piran, just a bench with a small bus sign by a pull-off. We had plenty of time to kill so we eventually found the spot to wait, but it was not immediately obvious. Allow some time to find it.
There was no way (at least that I had found) to buy tickets in advance, and we just barely made it on the bus, because when we got there, there were a few people (locals) already waiting for our bus. They boarded ahead of us, and we got the last 2 seats on the bus. If there had been more people waiting ahead of us, we would have been turned away and stuck there. That would have been highly problematic, because...
When we were there (May) the bus did not run every day. If we had failed to make our bus, the next bus wasn't for a day or two, which would have caused the rest of our trip to collapse like dominoes. I hadn't really expected bus capacity to be an issue (luckily it wasn't for us, but just barely so). I figured if we missed the bus we would take a taxi but that would have been super-expensive. Check bus schedules carefully for when you will be there - outside of "high season" (generally, but not always, defined as June-August) Croatian bus and ferry schedules may be very sparse (some routes go less frequently, some stop entirely). In late September, I would expect "high season" frequencies for transport to be just a distant memory.
We were there about 5 or 6 years ago and some things have undoubtedly changed since then (tourism in Croatia has exploded in recent years...thank Game of Thrones fans for at least some of that). If it were me going, I'd carefully check and double-check all the schedules, timetables and availability of guaranteeing a seat. Good luck and have fun.