Hey CityFeedback,
You might be able to enable iCloud Photos, which will, in theory, store all photos and videos within your Photos library within iCloud. Then, if you turned on iCloud Photos on the Mac, all of those same items would become available there, but it would be an all or nothing deal, in that you wouldn't be able to pick and choose which bits of the iCloud Photos library gets shared with the new Mac. Something else to consider is that if you only have the 5GB free storage on your iCloud account, you likely will not have enough storage to sync the contents of your Photos library from your iPhone to iCloud. This can be resolved by potentially increasing your iCloud storage. More information about these topics will be listed below, as this is more of a broad overview and some details and context may be needed to fully delve in and understand.
Set up and use iCloud Photos has all the info on the ins and outs of iCloud Photos and how to set it up on all of your devices. It also explains some of the finer points, such as changes made to one version of a photo or video will sync across all devices where that content appears.
iCloud+ plans and pricing can be found here. It can vary a bit by region, so this should give you a good idea of what you're looking at if this is something you'd like to partake in.
If you have any other questions, feel free to post back.
Have a great day.