The Blues, who have won three of the last four series, edged a tight first half 14-12 before scoring five unanswered tries in the second.
Penrith Panthers half-back Nathan Cleary, 24, converted all seven NSW tries, scoring two himself and kicking a penalty goal for a 24-point haul.
Queensland won game one 16-10 and host the decider in Brisbane on 13 July.
After Cleary's early penalty for the Blues, Queensland second row Felise Kaufusi touched down and Valentine Holmes converted to put them 6-2 ahead.