"Take the mickey" is an abbreviated form of the Cockney rhyming slang "take the mickey bliss" ("mickey" being slang for penis), meaning to "take the piss [out of someone]". The phrase has been noted since the 1930s.
 Alternate theories of origin
An alternate, unverified, and unlikely theory of etymology is that "mickey" is a contraction of "micturition" (i.e., piss), "mickey" being a suitable alternative when in the company of those liable to be offended by "piss".
Hold it. If '"mickey" is slang for penis, why bring in Mickey Bliss?
Who nobody has managed to identify, so the rhyming slang element is purely hypothetical. The BBC has
The OED isn’t certain, but says this might be cockney rhyming slang honouring one Mike or Mickey Bliss. If we could find out anything at all about Mr Bliss, we might establish whether the Dictionary are on to something or themselves taking the Michael. Several different versions of the expression arose in the 1930s and 40s. To take the mike seems to have come first in 1935, followed by take the piss in 1945. Take the mickey doesn’t appear until 1948, unless you know better.
Still, the OED
mickey, n.1 DRAFT REVISION Dec. 2001
[< Mickey, pet-form of the male forename Michael (see MICHAEL n.). Cf. MICK n.1, MIKE n.4, -Y6.
In phrase to take the mickey at sense 7 perh. after Mickey Bliss, rhyming slang for piss. Cf. earlier MIKE n.7]
7. colloq. (chiefly Brit.). to take the mickey (out of): to behave or speak satirically or mockingly; to make fun of, satirize, or debunk (a person or thing). Cf. MIKE n.7, PISS n. 2.
1948 A. BARON From City, from Plough vi. 49 ‘Higgsy,’ said the sergeant, ‘they think I'm taking the mickey. Tell 'em.’ 1952 ‘J. HENRY’ Who lie in Gaol iv. 66 She's a terror. I expect she'll try and take the mickey out of you all right. Don't you stand for nothin'. 1957 L. P. HARTLEY Hireling 134 He had no great regard for Constance, except in so far as she sometimes took the mickey out of Hughie. 1958 Observer 28 Dec. 3/1 ‘Tonight’ is not only a tough and irreverent programme, but glib and smart and anxious to take the mickey. 1960 E. W. HILDICK Jim Starling & Colonel ix. 76 The servers must have thought that no boy would dare to take the mickey in such circumstances. 1971 B. W. ALDISS Soldier Erect 101 Geordie looked anxiously at me, in case I thought he was taking the micky too hard. 1991 Sunday Sun (Brisbane) 3 Feb. 6/5, I don't think there is any subject that is too serious to take the micky out of.
does seem to establish that it's lower case.