Change MAMP to use a lower Mysql 5.1 version
Use a binary distribution (or compile from source) and then install using your system specific my.cnf (see below for mine).

pol@Pol-laptop:~/Downloads/mysql/src/inst5.6$ ./scripts/mysql_install_db --defaults-file=/home/pol/Downloads/mysql/src/my.cnf


Then, when you kick off your 5.1 instance, specify the my.cnf in the --defaults-file option to the mysqld daemon. I've never done this with 5.1 (why are you using 5.1?) but if you have problems, it could be due to the fact that older versions sometimes  appear to require that the --socket, --pid-file and --port options be specified separately. Experiment and post a new question if you're stuck.

pol@Pol-laptop:~/Downloads/mysql/src/inst5.6$ more my.cnf
[mysqld]
#
# * Basic Settings
#
user        = pol
pid-file    = /home/pol/Downloads/mysql/src/inst5.6/mysqld.pid
socket      = /home/pol/Downloads/mysql/src/inst5.6/mysql.sock
port        = 3306
basedir     = /home/pol/Downloads/mysql/src/inst5.6
datadir     = /home/pol/Downloads/mysql/src/inst5.6/data
tmpdir      = /tmp
pid-file    = /home/pol/Downloads/mysql/src/inst5.6/mysql.pid
lc-messages-dir = /home/pol/Downloads/mysql/src/inst5.6/share
lc-messages = en_US

general_log     = on
general_log_file= /home/pol/Downloads/mysql/src/inst5.6/logfile.txt

log_error   = /home/pol/Downloads/mysql/src/inst5.6/error.log
log-error   = /home/pol/Downloads/mysql/src/inst5.6/error.log

slow_query_log_file = /home/pol/Downloads/mysql/src/inst5.6/slow_query.log
slow_query_log  = 0

explicit-defaults-for-timestamp = TRUE

#language   = /home/pol/Downloads/mysql/src/inst5.6/share/english

# bind-address  = 0.0.0.0 - may not need c.f. host...

[client]
port        = 3306
socket      = /home/pol/Downloads/mysql/src/inst5.6/mysqld.sock
host            = 127.0.0.1
# or maybe localhost... cf. bind-address above...

# added from http://dev.mysql.com/doc/refman/5.6/en/load-data-local.html
# to allow for abrowse to load data!
#loose-local-infile =   1

local-infile    = 1 

[mysqld_safe]
#user       = linehanp
#socket     = /home/pol/Downloads/mysql/src/inst5.6/mysql.sock
#err-log        = /home/pol/Downloads/mysql/src/inst5.6/error.log
#pid-file   = /home/pol/Downloads/mysql/src/inst5.6/mysql.pid
#log_error  = /home/pol/Downloads/mysql/src/inst5.6/error.log
#log-error  = /home/pol/Downloads/mysql/src/inst5.6/error.log



pol@Pol-laptop:~/Downloads/mysql/src/inst5.6$