No not really as the top media and function keys are NOT the same or in the same order. Such as the eject key, won't find one on the newer models. If you use one of those keyboards, then you will also need to change the touchpad as the USB keyboard controller is attached to the back of the touchpad.
The keyboard would work, yet the those media & functions keys not match unless it had the right touchpad.
My advice is get the proper keyboard OR upper case.
By the way, have you disconnected and reattached the ribbon cable from the keyboard to the touchpad and also the ribbon cable from the touchpad to the logicboard? sometimes all it needs is a cleaning.
It may not be a bad keyboard as well, maybe the touchpad, I'd look at that first prior to ordering in a keyboard. There is a separate controller chip for the touchpad on the back of it, they don't share one with the keyboard
Good luck