In theory you can, and some projects use a CC-NC license for that reason.
But it's not a very good idea.
First, the CC-NC license is NOT Open Source. While it provides some user freedoms, it does not provide essential software freedoms like the ability to use the software for any purpose. I understand that freedom is explicitly not your goal, but it's important to understand that a project with such a license is largely outside of the Open Source ecosystem.
A more important issue is that Creative Commons licenses are about creative works in general, but have no provisions for the special needs of software. In particular, CC does not distinguish between a software and its source code. If you publish your source code, someone else can use it for any non-commercial purpose and merely has to attribute you. They don't have to release their versions under the same license, and they don't have to publish their modified source code at all. The reciprocal variant CC-BY-NC-SA fixes the first part of this, but still doesn't require that source code of modified versions is published.
Finally, there is the question of license reciprocality. When someone contributes to a project under some license, the general expectation is that the inbound license equals the outbound license: the project contributors received a license from the project that allows them to perform modifications, and they return their modifications under the same license. Here, the project would receive CC-BY-NC licensed contributions by default. In general, the project contributor would be copyright holder for their contributions. If you use the contributions, you are also bound by the license, including the NonCommercial terms.
To avoid this, project maintainers that want to retain full control over the project rights will generally require contributors to sign a Contributor License Agreement (CLA). Depending on the exact terms of this agreement, the project maintainer wouldn't be bound by the project's license. Templates for a reasonable CLA can be found at harmonyagreements.org. However, the use of CLAs implies more bureaucracy than a normal open source project. It has to be clear who receives the license in the CLA. An individual, who may die? Or perhaps a corporation?1 It's also necessary to get contributors to sign in a legally meaningful way. Is that a checkbox on a website? Or do they need to mail physical documents? Not insurmountable, but the details will depend on your jurisdiction, and that means all of this is more of a question for lawyers.
1: Software projects projects are not legal entities and cannot receive any rights. For open or source-available projects driven by a company, that company would want to receive the rights. Larger, more established community projects often found a non-profit foundation to manage these legal matters – also good for company-started projects that want to demonstrate their independence. Smaller open source projects with such needs might instead apply to an umbrella foundation like Apache or Software Freedom Conservancy. But they are picky about the projects they support.
Using non-open-source licenses and CLAs also makes it less likely to receive contributions at all. Unless your project is really awesome, why should someone spend effort on your project, when there are other projects with less restrictions? Why should someone give you more rights through a CLA than they would get themselves?
It is perfectly fine to use CC-NC if you understand the effects of doing this, but it's usually not a brilliant idea.