Is the word "play" used in the same way in the following two sentences?

Charlie likes to play Mary.

The engine has a wheel that is playing in a rack.
different meanings