The Irishman, 28, was beaten by Diaz's second-round rear-naked choke in their welterweight bout at UFC 196 in March.
On Saturday night, McGregor won the fight on points, with judges scoring the five-round battle 48-47 47-47 48-47 in the lightweight champion's favour.
"I'm not surprised, the king is back," McGregor said after the bout. "The first few rounds proved the class difference. But that toughness and durability that he has crept back in the later rounds.
"It's 1-1 - regroup, we'll do it again. This time at 155lbs. I came up to 170lbs, faced the bigger man, overcame adversity. You want this trilogy? It's on my terms, come back down to 155."
In Saturday's co-main event, top light heavyweight contender Anthony Johnson knocked out Glover Teixeira with a right uppercut to put himself into contention for a title fight against champion Daniel Cormier.