The 31-year-old had been linked with several European clubs and the Red Bulls are delighted to have won the chase for his signature.
"Rafael has shown on the club and international level that he is one of the world's top players," Dietmar Beiersdorfer, head of Red Bull Global Soccer, said in a statement.
"He has been a winner at all levels and illustrated that he is a leader both on and off the field.
"We are thrilled that he decided to come to the Red Bulls at this time in his career."
Marquez, who will be presented to the media at a news conference on Tuesday, also expressed his happiness at the deal.
"Coming to New York and playing in Major League Soccer was a chance that I could not refuse," said Marquez.
"I am committed to doing my very best to help the Red Bulls in their play-off push this year and compete for championships in the years to come."