For a general manager, free agency is like the NBA Finals. And Brooklyn GM Sean Marks has hit a Game 7 winner.

The Nets not only landed Kevin Durant and Kyrie Irving but found a creative way to finesse the cap enough to add DeAndre Jordan and Garrett Temple. And Marks and his capologists did it all without having to pare a single player from their roster.

Brooklyn came into free agency with $69 million in cap space, not including restricted free agent D’Angelo Russell. That left them $2 million short of being able to give Durant and Irving their respective four-year, $164 million and four-year, $141 million max deals.

The Nets were facing the prospect of having to trade both Rodions Kurucs and Dzanan Musa just to afford Durant and Irving.

But The Post had reported that Durant and Irving — who’d won 2016 Rio Olympic gold alongside Jordan — had discussed taking less to make room for their longtime friend. And on Sunday, that’s exactly what the Nets’ new dynamic duo did.

Various cap experts opined that the Nets may have put unlikely but possible bonuses on Durant and Irving’s contracts, benchmarks like making the Eastern Conference semis or reaching 45 wins. Former Nets assistant GM Bobby Marks suggested figures like $5.7 million for Durant and $4.9 million for Irving on ESPN, while Miami-based Albert Nahmad mentioned $5 million for the former and $4.3 million for the latter. That would get Brooklyn within $287,000 of the money needed to give Jordan a four-year, $40 million deal.

Ironically, Jordan spent last season with the Knicks, who’d hoped to put this trio together in the Garden.

The Nets have the room exception, which is going to Temple. A solid locker room presence, he’ll replace departing free agents Ed Davis and DeMarre Carroll in that regard and ink a two-year, $10 million contract with the second season a team option.

Carroll is headed to San Antonio in a culture fit if there ever was one. Davis is off to the fast-improving Jazz on a two-year, $10 million deal.