The record had previously been set by a work by Frida Kahlo, with whom Rivera had a decades-long tumultuous relationship.
Her Two Nudes in the Forest sold for $8m in 2016.
The Rivals was bought by an unnamed collector bidding over the phone.
It is part of the record-breaking sale of late US billionaire David Rockefeller's private art collection, which has become the highest-grossing sale of a single-owner art collection at auction.
The colourful painting depicts two men in conical hats attending a traditional Mexican celebration. It was commissioned by Abby Rockefeller, David Rockefeller's mother, for her own private collection.
In 1941, she gifted the painting to David and his wife Peggy, who hung it prominently in their living room at their home in Seal Harbor, Maine.
Another work by Rivera, Dance in Tehuantepec holds the record for the Latin American painting to fetch the highest sum ever, not just at auction.
More about: art