Dons boss Derek McInnes had been desperate to keep hold of the out-of-contract former Dundee United and Celtic winger.
But the 28-year-old has decided to make his move to America after being lured by the prospect of playing at City's base at Yankee Stadium.
Mackay-Steven, who will join up with his new side once he secures a US work visa, told the New York City club website: "I'm delighted to finally sign on the dotted line.
"I can't wait to hit the ground running and make my debut in the blue shirt. I can't wait to show what I can do to the fans in Yankee Stadium.
"The lure of playing in America and in MLS is really attractive to me. It's always been a draw for me, it's hard to say no. I can't wait to get started.
"You see NYCFC from afar and the way they play football is the way it should be played."
Mackay-Steven, who scored 15 goals in 68 appearances for the Dons during his two seasons at the club, is convinced he can help New York City win silverware.
"A player like me, coming into an atmosphere when the philosophy is in place, it is going to be enjoyable. I want to learn as much as I can and hopefully hit the ground running," added Mackay-Steven.
"I like to make things happen and to get fans off their seats. Hopefully, I can do that in New York and show what I'm all about.
"I feel everything is in place to win a trophy. A squad like New York, with the structure in place, it's really in the team's grasp and hopefully, I can chip in with goals and assists."
City's sporting director, and former Rangers midfielder, Claudio Reyna claimed Mackay-Steven is a player City "have been tracking for some time".
Reyna added; "We're excited to add him to our squad. He's an out-and-out winger that can play on both sides of the pitch and strengthens our attacking options.
"We have a core group of experienced players who form the spine of our team and Gary possesses the same leadership qualities that already exist in our locker room.
"He's played in big games in Europe, has been part of title-winning teams, and we're really excited to have him join NYCFC."