Christine Ammer, The American Heritage Dictionary of Idioms, second edition (2013) has this relevant entry:
push someone's buttons Also, press someone's buttons. Draw a strong emotional response from someone, especially anger or sexual arousal. For example, My mother-in-law really knew how to push my buttons, or A good-looking redhead, she always seemed to press his buttons. This metaphoric expression transfers activating some mechanism by pressing buttons to human emotions {Slang, 1920s}
And J.E. Lighter, Random House Historical Dictionary of American Slang (1994) has this:
push (someone's) buttons to elicit a strongly favorable or unfavorable emotional response (from someone), esp. anger or sexual excitement. Also vars. [Earliest two cited examples:] 1927 H. Miller Moloch 22: I must have just touched the button. {1936 in Garon Blues 69: Just press my button, give my bell a ring.}
The 1927 instance that Lighter cites is from Henry Miller, Moloch: Or This Gentile World. Unfortunately I couldn't find a previewable or snippet-viewable copy of this novel online, so I can't add any context to the very brief excerpt that appears there. The 1936 example reproduced in Paul Garon, Blues and the Poetic Spirit (1996), however, is readable in full. It's from a song (evidently actually from 1932) sung by Lil Johnson (with Black Bob) titled "Press My Button":
My man thought he was raising sand, / I said "Give it to me, baby, you don't understand. / Where'd you put that thing? / Where'd you put that thing? / Just press my button, give my bell a ring."
Come on baby, let's have some fun, / Put your hot dog in my bun, / And I'll have that thing, / That ting-a-ling. / Just press my button, give my bell a ring.
My man's out in the rain and cold, / He's got the right key but just can't find the hole. / He say, "What's that thing? / That ting-a-ling. / I've been pressing your button, and your bell won't ring."
This was about 47 years before disco princess Anita Ward mined the same shaft with "Ring My Bell."
Interestingly, Lighter also includes an entry for a somewhat similar and slightly older expression:
push the right buttons to manage to get the desired results, esp. by manipulating another person. [Earliest cited example:] {1906 A.H. Lewis Confessions 22: Now, if you give me any lip, I'll push a button or two and have you sent out to Harlem.}
Lighter doesn't claim any lineal connection between the two expressions, but the idea of "pushing a button" as a figurative representation of manipulating someone seems quite strong in both phrases.
One of the earliest instances of "button pushing" as a metaphor for exerting control over another person appears in Anonymous, "I Pursue My M.A." in The New Student (February 15, 1928):
But last summer is gone and it is the present that is worrying me now. I looked forward to this graduate school as a sort of heaven. I was tired of having other persons push my thinking buttons; here, I believed, I should get a chance to push them for myself.
Even earlier is this instance from Kate Sargent, "Push or Be Pushed," in Forum (October 1927):
The Pedestrian's note of alarm over the prospect of too much leisure struck no responsive chord in this optimistic breast. The purveying of news—my job,—holds out as yet no threat of any future two hour day. It can not be fulfilled by pressing a button; rather, I should say, we are the buttons that other people push.
Nevertheless, Lil Johnson aside, these early instances don't precisely involve the now-familiar sense of "pushing someone's buttons" as a metaphor for directing or controlling that person's emotional response. One of the earliest instances I've found of that modern usage appears is in L. Ron Hubbard, Dianetics: The Modern Science of Mental Health, a Handbook of Dianetic Therapy (1950):
find that certain words make the husband wince or make him angry or make him refrain from doing something and so they use these "push-buttons". And husbands find their wives' push-buttons and keep them from buying clothes or using the car. This defensive and offensive dueling amongst aberrees is occasioned by push-buttons reacting against push-buttons. Whole populaces are handled by their push-button responses. Advertising learns about push-buttons and uses them in such things as "body-odor" or constipation. And in the entertainment field and the song-writing field push-buttons are pushed in whole racks and batteries to produce aberrated responses. Pornography appeals to people who have pornographic push-buttons. Corn-and-games government appeals to people who have "care for me" push-buttons and others. It might be said that there is no necessity to appeal to reason when there are so many push-buttons around.
...
... and any other precise restimulator can "push-button" the aberree into action or apathy if they are used upon him. In words it has to be the exact word; for instance painted will not do when painter is in the engram. What is painted, however, may be an associative restimulator and the aberree may declare he does not like it; that he does not like it does not mean that it will "push his buttons" and make him cough or sigh or get angry or get sick or whatever the engram containing the word dictates he should do.)
Given the vast readership of this book over the decades, I would not be surprised if Hubbard's lengthy discourse on "push-button" responses to strategic (or at least tactical) verbal stimuli bears much of the responsibility for popularization, during the second half of the twentieth century, of the concept of "pushing [someone's] buttons." If so, I'm glad it was "push his buttons" that made the jump into the mainstream English vocabulary rather than "aberree" or "restimulator."