Rivera's partner, Wilbert Mora, 27, is fighting for his life at Harlem Hospital, CBS2's Leah Mishkin reported.
Community members and elected officials gathered Saturday night outside the 32nd Precinct to pray.
"Violence won't divide us. It will unite us," Mayor Eric Adams said.
Michelle Rodriguez was Rivera's neighbor when he was growing up in Inwood. She says he was newly married and she last saw him a few days ago.
"He was a caring guy, caring guy. Always a gentleman. Helping with bags, looking for parking. He was always available to me, to all of us," Rodriguez told CBS2's Kiran Dhillon. "He was very proud to be going to the academy to become an officer and look what happened. It's just devastating."
Rivera, 22, had only been an NYPD officer for a little more than a year, but his love for the job was evident.
A letter Rivera wrote as a probationary officer reveals why he wanted to join the NYPD.
"When I applied to become a police officer, I knew this was the career for me. Coming from an immigrant family, I will be the first to say that I am a member of the NYPD, the greatest police force in the world," he wrote.
He went on to say he wanted to "better the relationship between the community and the police."
His old neighbor Berlin Paulino got emotional while speaking about him.
"He was just very sweet, a very sweet kid and very kind. Like, every time you used to see him around, like, he would just say hi to you," she said.
Paulino says she saw Rivera the day he graduated from the academy.
"He just looked so happy, honestly. That's all I can say. He was just so happy," she said. "He was so proud, and it's so heartbreaking, honestly."
Many of Rivera's friends attended Saturday night's vigil. They told CBS2 they are devastated by his death and praying for his family.
"I am struggling to find the words to express the tragedy we are enduring. We're mourning, and we are angry," NYPD Commissioner Keechant Sewell said Friday night. "The pain their families are experiencing is not something anyone can put into words."
The NYPD tweeted early Saturday, "We mourn the loss of a hero officer - a son, husband and friend."
"We had the privilege to pray with this family. I asked you to pray for them too. Please pray for our officer that lies in his hospital bed fighting for his life," Sewell said.
"Right now, every mother in this city feels the loss that this family is experiencing," Adams said.
"My thoughts are with the family who answered the phone to receive the news they've always dreaded: that their loved one, who had sworn to protect and serve New Yorkers by joining the NYPD, will not be coming home," Gov. Kathy Hochul said in a statement. "I am praying for the recovery of his partner, the officer who is fighting for his life, and for his family. I know that all of New York is standing with these officers and their families."
"I offer and extend my prayers to the family of the NYPD officer killed tonight, to the officer fighting for his life, and to their fellow officers at the 32nd Precinct and across the city. These men answered a plea for help, both risked and one lost their life, all while trying to protect another New Yorker's safety as countless officers across our city do each day," Public Advocate Jumaane Williams said in a statement.
"All of New York state is in mourning tonight. As we await the facts, my office may assert jurisdiction in this matter. We pray for the safety of our police and our communities," Attorney General Letitia James said in a statement.
Officers lined the halls of Harlem Hospital.
"They just carried two brothers out of a hallway to this hospital to try to save their lives. Hundreds and hundreds of police officers are standing here today because their hearts tell them they have to be here, because they feel like they're alone. We got to end that here, today. Our hearts are broken, we're in shock. Our knees are buckling and we're angry, because we've been here before," said PBA President Patrick Lynch.
Officers Rivera and Mora are the fourth and fifth NYPD officers shot in the line of duty in 2022.
CBS2's Leah Mishkin and Kiran Dhillon contributed to this report.
for more features.